From cf5cc90b25fb53aec85c59d8d62fae3d3b05bc86 Mon Sep 17 00:00:00 2001 From: Jarrod Millman Date: Thu, 10 Sep 2020 10:51:02 -0700 Subject: Populate setup.py requires from requirements --- setup.py | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 6e9106bd..3c3d86c5 100644 --- a/setup.py +++ b/setup.py @@ -124,23 +124,18 @@ package_data = { "networkx.utils": ["tests/*.py"], } -install_requires = [ - "decorator>=4.3.0", - "numpy>=1.19; platform_python_implementation!='PyPy' and python_version<'3.9'", - "scipy>=1.4; platform_python_implementation!='PyPy' and python_version<'3.9'", - "matplotlib>=3.2; platform_python_implementation!='PyPy' and python_version<'3.9'", - "pandas>=1.0; platform_python_implementation!='PyPy' and python_version<'3.9'", -] + +def parse_requirements_file(filename): + with open(filename, encoding="utf-8") as fid: + requires = [l.strip() for l in fid.readlines() if l] + + return requires + + +install_requires = parse_requirements_file("requirements/default.txt") extras_require = { - "extra": [ - "lxml>=4.5", - "pygraphviz>=1.5, <2.0", - "pydot>=1.4.1", - "pyyaml>=5.3", - ], - "gdal": ["gdal"], - "pydot": ["pydot"], - "pygraphviz": ["pygraphviz"], + dep: parse_requirements_file("requirements/" + dep + ".txt") + for dep in ["developer", "doc", "extra", "test"] } with open("README.rst", "r") as fh: -- cgit v1.2.1