Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
vauxoo-dev
reqgen
Commits
894b67a6
Commit
894b67a6
authored
Jun 08, 2016
by
Tulio Ruiz
Browse files
[IMP] added suppor for click
parent
7026077f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
reqgen/reqgen.py
reqgen/reqgen.py
+11
-13
requirements.txt
requirements.txt
+1
-0
setup.py
setup.py
+5
-1
No files found.
reqgen/reqgen.py
View file @
894b67a6
#!/usr/bin/python
# -*- coding: utf-8 -*-
import
argparse
import
click
import
copy
import
fnmatch
from
six
import
iteritems
import
os
import
requirements
import
sys
def
gt
(
first
,
second
):
...
...
@@ -95,15 +94,14 @@ def search_reqs_files(folder_name):
return
res
def
main
(
arguments
):
parser
=
argparse
.
ArgumentParser
(
description
=
'Process some integers.'
)
parser
.
add_argument
(
'dest_file'
,
type
=
str
,
help
=
'The file where all requirements will be saved'
)
parser
.
add_argument
(
'--path'
,
default
=
'.'
,
help
=
'Path where to search'
)
args
=
parser
.
parse_args
(
arguments
)
generate_merged_file
(
args
.
dest_file
,
args
.
path
)
@
click
.
command
()
@
click
.
option
(
'--path'
,
default
=
'.'
,
type
=
click
.
Path
(
exists
=
True
,
readable
=
True
),
help
=
'Path where you what to search the requirements files'
)
@
click
.
argument
(
'dest_file'
,
type
=
click
.
Path
(
file_okay
=
True
,
writable
=
True
))
def
main
(
dest_file
,
path
):
generate_merged_file
(
dest_file
,
path
)
return
0
if
__name__
==
'__main__'
:
sys
.
exit
(
main
(
sys
.
argv
[
1
:]))
requirements.txt
View file @
894b67a6
click
==6.6
requirements-parser
==0.1.0
setup.py
View file @
894b67a6
...
...
@@ -51,5 +51,9 @@ setup(
'Programming Language :: Python :: 3.5'
,
],
test_suite
=
'tests'
,
tests_require
=
test_requirements
tests_require
=
test_requirements
,
entry_points
=
'''
[console_scripts]
reqgenv=reqgen.reqgen:main
'''
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment