Commit e4f632ba authored by Leo Pound Singer's avatar Leo Pound Singer
Browse files

Use PEP 508 python_version specs for test_requires

This allows us to specify requirements that depend upon the Python
version, so that the requirements can be expressed purely as
configuration and not as code.
parent 5b53da72
Pipeline #91779 failed with stages
in 3 minutes and 14 seconds
......@@ -39,19 +39,6 @@ with open(readme_file, 'rb') as f:
long_description = f.read().decode().strip()
# Required packages for tests
tests_require = []
# Add pytest requirement - 5.0.0+ only supports Python 3.5+
pytest_requirement = 'pytest>=3.1.0'
if sys.version_info < (3, 5):
pytest_requirement += ',<5.0.0'
tests_require.append(pytest_requirement)
tests_require.append('pytest-cov')
# Add mock for Python 2
if sys.version_info.major < 3:
tests_require.append('mock>=2.0.0')
# Only install setup_requires for the specific command being used
SETUP_REQUIRES = []
if 'test' in sys.argv:
......@@ -97,7 +84,12 @@ setup(
classifiers=CLASSIFIERS,
install_requires=['future>=0.15.0', 'six>=1.9.0', 'cryptography>=1.7.2'],
setup_requires=SETUP_REQUIRES,
tests_require=tests_require,
tests_require=[
'mock>=2.0.0; python_version<"3"',
'pytest>=3.1.0; python_version>="3"',
'pytest>=3.1.0,<5.0.0; python_version<"3"',
'pytest-cov',
],
package_data={
'ligo.gracedb.test': [
'integration/data/*',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment