diff --git a/setup.cfg b/setup.cfg index 0d423548..8c56440c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,5 +33,3 @@ setup_requires = pytest-runner python_requires = >= 3.6 -install_requires = file: requirements.txt -tests_require = file: requirements-tests.txt diff --git a/setup.py b/setup.py index f23fb433..ce402e03 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,20 @@ #!/usr/bin/env python3 from setuptools import setup + +def requirements(section=None): + """Helper for loading dependencies from requirements files.""" + if section is None: + filename = "requirements.txt" + else: + filename = f"requirements-{section}.txt" + + with open(filename) as file: + return [line.strip() for line in file] + + # See setup.cfg for the actual configuration. -setup() +setup( + install_requires=requirements(), + tests_require=requirements('tests'), +)