summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorChandan Singh <csingh43@bloomberg.net>2018-08-10 21:33:04 +0100
committerChandan Singh <csingh43@bloomberg.net>2018-08-11 16:46:05 +0100
commit95920f48df826dea75e137f00a0abd2ea1d72775 (patch)
tree6dc784c7b98e79e98a79b2e5fd017099e4da3a04 /setup.py
parent2e8db54ea7b0b324f6daa47bc031a146a3eee9fa (diff)
downloadbuildstream-95920f48df826dea75e137f00a0abd2ea1d72775.tar.gz
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.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/setup.py b/setup.py
index fec33047d..700d9df96 100755
--- a/setup.py
+++ b/setup.py
@@ -219,6 +219,15 @@ def get_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 #
#####################################################
setup(name='BuildStream',
@@ -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)