diff options
author | Kali Kaneko <kali@leap.se> | 2015-07-22 10:31:59 -0400 |
---|---|---|
committer | Kali Kaneko <kali@leap.se> | 2015-07-22 12:28:27 -0400 |
commit | d0535f4e613dddef4037f62bb42a6b8250489871 (patch) | |
tree | 866cc833181872e18a00247052f019179f2ff817 /keymanager | |
parent | b954f6bfe19a11b579735cc642d61d250ee378df (diff) |
[pkg] separate leap requirements
this is part of a process to make the setup of the development mode less
troublesome. from now on, setting up a virtualenv in pure development
mode will be as easy as telling pip to just install the external
dependencies::
pip install -r pkg/requirements.pip
and traversing all the leap repos for the needed leap dependencies doing::
python setup.py develop
- Related: #7288
Diffstat (limited to 'keymanager')
-rw-r--r-- | keymanager/pkg/requirements-leap.pip | 1 | ||||
-rw-r--r-- | keymanager/pkg/requirements.pip | 5 | ||||
-rw-r--r-- | keymanager/pkg/utils.py | 11 | ||||
-rw-r--r-- | keymanager/setup.py | 6 |
4 files changed, 15 insertions, 8 deletions
diff --git a/keymanager/pkg/requirements-leap.pip b/keymanager/pkg/requirements-leap.pip new file mode 100644 index 00000000..b311859e --- /dev/null +++ b/keymanager/pkg/requirements-leap.pip @@ -0,0 +1 @@ +leap.common>=0.4.0 diff --git a/keymanager/pkg/requirements.pip b/keymanager/pkg/requirements.pip index 1aef332e..c4cb09af 100644 --- a/keymanager/pkg/requirements.pip +++ b/keymanager/pkg/requirements.pip @@ -1,6 +1,5 @@ -leap.common>=0.4.0 -simplejson -requests # if we bump the gnupg version, bump also the sanity check # in keymanager.__init__ gnupg>=1.4.0 +simplejson +requests diff --git a/keymanager/pkg/utils.py b/keymanager/pkg/utils.py index deace14b..dd3deaca 100644 --- a/keymanager/pkg/utils.py +++ b/keymanager/pkg/utils.py @@ -27,7 +27,7 @@ import sys def get_reqs_from_files(reqfiles): """ Returns the contents of the top requirement file listed as a - string list with the lines + string list with the lines. @param reqfiles: requirement files to parse @type reqfiles: list of str @@ -43,6 +43,9 @@ def parse_requirements(reqfiles=['requirements.txt', """ Parses the requirement files provided. + The passed reqfiles list is a list of possible locations to try, the + function will return the contents of the first path found. + Checks the value of LEAP_VENV_SKIP_PYSIDE to see if it should return PySide as a dep or not. Don't set, or set to 0 if you want to install it through pip. @@ -58,9 +61,9 @@ def parse_requirements(reqfiles=['requirements.txt', if re.match(r'\s*-e\s+', line): pass # do not try to do anything with externals on vcs - #requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', - #line)) - # http://foo.bar/baz/foobar/zipball/master#egg=foobar + # requirements.append(re.sub(r'\s*-e\s+.*#egg=(.*)$', r'\1', + # line)) + # http://foo.bar/baz/foobar/zipball/master#egg=foobar elif re.match(r'\s*https?:', line): requirements.append(re.sub(r'\s*https?:.*#egg=(.*)$', r'\1', line)) diff --git a/keymanager/setup.py b/keymanager/setup.py index 778909d0..f554e09e 100644 --- a/keymanager/setup.py +++ b/keymanager/setup.py @@ -107,6 +107,10 @@ cmdclass["freeze_debianver"] = freeze_debianver # XXX add ref to docs +requirements = ( + utils.parse_requirements() + + utils.parse_requirements(reqfiles=["pkg/requirements-leap.pip"])) + setup( name='leap.keymanager', version=VERSION, @@ -129,7 +133,7 @@ setup( packages=find_packages('src', exclude=['leap.keymanager.tests']), package_dir={'': 'src'}, test_suite='leap.keymanager.tests', - install_requires=utils.parse_requirements(), + install_requires=requirements, tests_require=utils.parse_requirements( reqfiles=['pkg/requirements-testing.pip']), ) |