From 51624331cdc592c322eb8ab2aad8c0e889cca0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Touceda?= Date: Mon, 11 Mar 2013 16:53:39 -0300 Subject: Add PySide as a dependency and a way to skip it through an env var --- pkg/requirements.pip | 3 ++- pkg/utils.py | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/requirements.pip b/pkg/requirements.pip index 0f2e804e..7336d436 100644 --- a/pkg/requirements.pip +++ b/pkg/requirements.pip @@ -7,4 +7,5 @@ srp>=1.0.2 pyopenssl keyring pyxdg -argparse \ No newline at end of file +argparse +PySide \ No newline at end of file diff --git a/pkg/utils.py b/pkg/utils.py index c6c57652..0b1ea019 100644 --- a/pkg/utils.py +++ b/pkg/utils.py @@ -23,13 +23,18 @@ def parse_requirements(reqfiles=['requirements.txt', 'requirements.pip', 'pkg/requirements.pip']): """ - Parses the requirement files provided + Parses the requirement files provided. + + 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. @param reqfiles: requirement files to parse @type reqfiles: list of str """ requirements = [] + skip_pyside = os.getenv("LEAP_VENV_SKIP_PYSIDE", "0") != "0" for line in get_reqs_from_files(reqfiles): # -e git://foo.bar/baz/master#egg=foobar if re.match(r'\s*-e\s+', line): @@ -47,6 +52,8 @@ def parse_requirements(reqfiles=['requirements.txt', # adding it to the requirements list screws distro installs elif line == 'argparse' and sys.version_info >= (2, 7): pass + elif line == 'PySide' and skip_pyside: + pass else: if line != '': requirements.append(line) -- cgit v1.2.3