From dce09676aed5d3b6bcf24f04784d9f6ebef65328 Mon Sep 17 00:00:00 2001 From: Will Barton Date: Mon, 21 May 2018 09:36:51 -0400 Subject: [PATCH] Use abstract spec for dependencies in setup.py `pip.req.parse_requirements` is not available in pip 10, so this package breaks when attempting to install it with pip 10. This change also makes the logical distinction between the abstract dependencies in setup.py and the concrete dependencies in requirements.txt. I believe these to be reasonable version ranges based on what we have in cfgov-refresh already, what's specified in requirements.txt, and the changelog for each of the dependencies. --- setup.py | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/setup.py b/setup.py index 469078ae..fb5277eb 100644 --- a/setup.py +++ b/setup.py @@ -9,27 +9,16 @@ long_description = f.read() -def parse_requirements(): - """Return abstract requirements (without version numbers) - from requirements.txt. - As an exception, requirements that are URLs are used as-is. - This is tested to be compatible with pip 9.0.1. - Background: https://stackoverflow.com/a/42033122/ - """ +install_requires = [ + 'Django>=1.8,<1.9', + 'djangorestframework>=3.1,<3.2', + 'elasticsearch>=2.4.1,<3', + 'requests>=2.14,<2.15', + 'urllib3>=1.21,<1.22', + 'django-localflavor>=1.5,<1.6', + 'wagtail-flags>=2.0.5,<2.2' +] - path = os.path.join(os.path.dirname(__file__), 'requirements.txt') - requirements = pip.req.parse_requirements( - path, session=pip.download.PipSession() - ) - requirements = [ - req.name or req.link.url - for req in requirements - if 'git+' not in (req.name or req.link.url) - ] - return requirements - - -install_requires = parse_requirements() setup( name='ccdb5-api',