Commit 95920f48 authored by Chandan Singh's avatar Chandan Singh
Browse files

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
buildstream-docker-images!56.
parent 2e8db54e
Loading
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -21,3 +21,6 @@ recursive-include tests *.expected

# Protocol Buffers
recursive-include buildstream/_protos *.proto

# Requirements files
dev-requirements.txt

dev-requirements.txt

0 → 100644
+12 −0
Original line number Diff line number Diff line
# Pin coverage to 4.2 for now, were experiencing
# random crashes with 4.4.2
coverage == 4.4.0
pep8
pytest >= 3.1.0
pytest-cov >= 2.5.0
pytest-datafiles
pytest-env
pytest-pep8
pytest-pylint
# Provide option to run tests in parallel, less reliable
pytest-xdist
+11 −13
Original line number Diff line number Diff line
@@ -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)