Skip to content

Commit

Permalink
Merge pull request #73 from cfpb/abstract-deps
Browse files Browse the repository at this point in the history
Use abstract spec for dependencies in setup.py
  • Loading branch information
willbarton authored May 23, 2018
2 parents 6270754 + dce0967 commit a7a77ff
Showing 1 changed file with 9 additions and 20 deletions.
29 changes: 9 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a7a77ff

Please sign in to comment.