From 874249e30f2a6f9fbd96455f7146b367d1c71072 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sat, 18 May 2013 09:50:14 -0700 Subject: Add support for requirements.txt. In prep for moving the projects to requirements.txt and test-requirements.txt, we need to have our legacy install_venv codebase support finding requirements in the right place. Change-Id: I0f300c6bb1792c81e2133a41a5631f2dd4c021ba --- tools/patch_tox_venv.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/patch_tox_venv.py b/tools/patch_tox_venv.py index e23cf74..a3340f2 100644 --- a/tools/patch_tox_venv.py +++ b/tools/patch_tox_venv.py @@ -20,13 +20,25 @@ import sys import install_venv_common as install_venv +def first_file(file_list): + for candidate in file_list: + if os.path.exists(candidate): + return candidate + + def main(argv): root = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) venv = os.environ['VIRTUAL_ENV'] - pip_requires = os.path.join(root, 'tools', 'pip-requires') - test_requires = os.path.join(root, 'tools', 'test-requires') + pip_requires = first_file([ + os.path.join(root, 'requirements.txt'), + os.path.join(root, 'tools', 'pip-requires'), + ]) + test_requires = first_file([ + os.path.join(root, 'test-requirements.txt'), + os.path.join(root, 'tools', 'test-requires'), + ]) py_version = "python%s.%s" % (sys.version_info[0], sys.version_info[1]) project = 'oslo' install = install_venv.InstallVenv(root, venv, pip_requires, test_requires, -- cgit