From 95920f48df826dea75e137f00a0abd2ea1d72775 Mon Sep 17 00:00:00 2001 From: Chandan Singh Date: Fri, 10 Aug 2018 21:33:04 +0100 Subject: Move development reqirements to dev-requirements.txt In some cases, such as when working inside a virtual environment, it can be desirable to install all dependencies for running tests using `pip`. This is currently not possible since setuptools does not support installing these dependencies in a virtual environment (by design). (See https://stackoverflow.com/a/21003259.) To circumvent this issue, move such requirements to `dev-requirements.txt` file that can be used easily with `pip install -r`. This also enables tests to be run directly using `pytest`, which can be more convenient than `-addopts` approach when one needs to add multiple options. This will also be useful in creating better testuite images, and fix some of the issues noticed in https://gitlab.com/BuildStream/buildstream-docker-images/merge_requests/56. --- setup.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index fec33047d..700d9df96 100755 --- a/setup.py +++ b/setup.py @@ -218,6 +218,15 @@ def get_cmdclass(): return cmdclass +##################################################### +# Gather requirements # +##################################################### +setup_requires = set(['pytest-runner']) +with open('dev-requirements.txt') as dev_reqs: + dev_requires = set([line for line in dev_reqs.read().split('\n') + if not line.strip().startswith('#')]) + + ##################################################### # Main setup() Invocation # ##################################################### @@ -260,17 +269,6 @@ setup(name='BuildStream', 'grpcio >= 1.10', ], entry_points=bst_install_entry_points, - setup_requires=['pytest-runner'], - tests_require=['pep8', - # Pin coverage to 4.2 for now, we're experiencing - # random crashes with 4.4.2 - 'coverage == 4.4.0', - 'pytest-datafiles', - 'pytest-env', - 'pytest-pep8', - 'pytest-pylint', - 'pytest-cov >= 2.5.0', - # Provide option to run tests in parallel, less reliable - 'pytest-xdist', - 'pytest >= 3.1.0'], + setup_requires=list(setup_requires), + tests_require=list(dev_requires - setup_requires), zip_safe=False) -- cgit v1.2.1