diff --git a/setup.py b/setup.py index 8006fd4..a81bf1e 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ # Always prefer setuptools over distutils +from pip._internal.req import parse_requirements from setuptools import setup, find_packages # To use a consistent encoding from codecs import open @@ -11,13 +12,8 @@ with open(path.join(here, 'README.md'), encoding='utf-8') as f: long_description = f.read() -with open('requirements.txt', encoding='utf-8') as f: - install_requires = map(lambda line: line.strip(), f.readlines()) - install_requires = filter(lambda line: bool(line), install_requires) - -with open('test-requirements.txt', encoding='utf-8') as f: - test_requires = map(lambda line: line.strip(), f.readlines()) - test_requires = filter(lambda line: bool(line), install_requires) +install_requires = [req.req for req in parse_requirements('requirements.txt')] +test_requires = [req.req for req in parse_requirements('test-requirements.txt')] setup( name='freenom dns updater', @@ -80,7 +76,7 @@ # your project is installed. For an analysis of "install_requires" vs pip's # requirements files see: # https://packaging.python.org/en/latest/requirements.html - install_requires=list(install_requires), + install_requires=install_requires, # List additional groups of dependencies here (e.g. development # dependencies). You can install these using the following syntax, @@ -88,7 +84,7 @@ # $ pip install -e .[dev,test] extras_require={ 'dev': ['check-manifest'], - 'test': list(test_requires), + 'test': test_requires, }, # If there are data files included in your packages that need to be