Refactor dependency management.

parent 1478ef70
......@@ -22,6 +22,7 @@ statsd
Pillow # screenshots
python-resize-image # screenshots
untangle # dns scans https://github.com/stchris/untangle
django_uwsgi
dnspython # dnsrecon
netaddr # dnsrecon
......
......@@ -44,9 +44,13 @@ def get_version():
return '0.0.0'
def requirements(filename='requirements.txt'):
def requirements(extra=None):
"""Return list of required package names from requirements.txt."""
# strip trailing comments, and extract package name from git urls.
if extra:
filename = 'requirements.' + extra + '.txt'
else:
filename = 'requirements.txt'
requirements = [r.strip().split(' ', 1)[0].split('egg=', 1)[-1]
for r in open(filename) if not r.startswith('#')]
return requirements
......@@ -59,8 +63,8 @@ setup(
install_requires=requirements(),
# allow extra packages to be installed, eg: `pip install -e .[deploy]`
extras_require={
'development': requirements('requirements.dev.txt'),
'deploy': requirements('requirements.deploy.txt'),
'development': requirements(extra='dev'),
'deploy': requirements(extra='deploy'),
},
entry_points={
'console_scripts': [
......
......@@ -5,10 +5,7 @@ envlist = check,py34,datasets
[testenv]
basepython = python3
usedevelop = True
deps =
-rrequirements.txt
-rrequirements.dev.txt
{env:TOX_EXTRA_DEPS:}
extras = development
setenv =
DJANGO_SETTINGS_MODULE = failmap_admin.settings
......@@ -41,11 +38,6 @@ commands =
# utility to perform autofixing of trivial code quality issues
[testenv:autofix]
# install all dependencies so isort knows packages belong where
deps =
# install dev requirements for required tools
-rrequirements.dev.txt
# install package dependencies to make sure isort known third party packages
-rrequirements.txt
commands =
# fix trivial pep8 style issues
autopep8 -ri failmap_admin tests setup.py
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment