Skip to content
This repository has been archived by the owner on Jun 12, 2018. It is now read-only.

Commit

Permalink
Move requirements to setup.py and handle dev dependencies more gracef…
Browse files Browse the repository at this point in the history
…ully.
  • Loading branch information
Jeremy Thurgood committed Jan 10, 2014
1 parent 6d0dd00 commit 3f2d31d
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 67 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ install:
# We easy_install a binary riak_pb package because pip install needs `protoc'.
- "easy_install 'riak_pb<1.3.0'"
# For some reason we need these two as well.
- "pip install https://github.com/praekelt/vumi/tarball/develop#egg=vumi-dev"
- "pip install https://github.com/praekelt/vumi-wikipedia/tarball/develop#egg=vumi-wikipedia-dev"
- "pip install -r requirements.pip --use-wheel"
- "pip install -r requirements-pytest.pip --use-wheel"
- "pip install -r requirements-dev.pip --use-wheel"
- "pip install overalls"
- "npm install"
before_script:
Expand Down
4 changes: 4 additions & 0 deletions requirements-pytest.pip → requirements-dev.pip
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
pep8
pyflakes
supervisor
coverage
pytest
pytest-django
pytest-xdist
Expand Down
40 changes: 9 additions & 31 deletions requirements.pip
Original file line number Diff line number Diff line change
@@ -1,31 +1,9 @@
Django==1.5.5
django-nose==1.0
nose==1.1.2
gunicorn==0.15.0
pep8==0.6.1
pyflakes==0.4.0
supervisor==3.0a10
coverage==3.7
South==0.8.2
psycopg2==2.4
Fabric==1.2.2
celery==3.0.23
django-celery==3.0.23
django-celery-email
https://github.com/praekelt/vumi/tarball/develop#egg=vumi-dev
https://github.com/praekelt/vxpolls/tarball/develop#egg=vxpolls-dev
Markdown==2.1.1
django-registration==1.0
lesscpy==0.9h
xlrd==0.8.0
https://github.com/praekelt/vumi-wikipedia/tarball/develop#egg=vumi-wikipedia-dev
requests==0.14.2
mock==1.0.1
raven>=2.0,<3.0
django-debug-toolbar==0.9.4
kombu==2.5.6
librabbitmq==1.0.1
hiredis==0.1.1
django-pipeline==1.3.6
txpostgres==1.1.0
django-crispy-forms==1.4.0
# Our dependencies are all specified in setup.py.

# The following three packages need to be installed from the their repositories because we depend on dev versions.

-e git+https://github.com/praekelt/vumi.git#egg=vumi
-e git+https://github.com/praekelt/vxpolls.git#egg=vxpolls
-e git+https://github.com/praekelt/vumi-wikipedia.git#egg=vumi-wikipedia

-e .
65 changes: 32 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,6 @@
from setuptools import setup, find_packages
import re


def listify(filename):
return filter(None, open(filename, 'r').read().split('\n'))


_SIMPLE_VERSION_RE = re.compile("(?P<name>.*)-(?P<version>[0-9.]+|dev)$")


def parse_requirements(filename):
install_requires = []
dependency_links = []
for requirement in listify(filename):
if requirement.startswith("#"):
continue
if requirement.startswith("-e"):
continue
if requirement.startswith("https:") or requirement.startswith("http:"):
(_, _, name) = requirement.partition('#egg=')
ver_match = _SIMPLE_VERSION_RE.match(name)
if ver_match:
# egg names with versions need to be converted to
# an == requirement.
name = "%(name)s==%(version)s" % ver_match.groupdict()
install_requires.append(name)
dependency_links.append(requirement)
else:
install_requires.append(requirement)
return install_requires, dependency_links

install_requires, dependency_links = parse_requirements("requirements.pip")

setup(
name="vumi-go",
version="0.5.0-dev",
Expand All @@ -42,8 +11,38 @@ def parse_requirements(filename):
author='Praekelt Foundation',
author_email='dev@praekeltfoundation.org',
packages=find_packages(),
install_requires=install_requires,
dependency_links=dependency_links,
install_requires=[
'vumi>0.4',
'vxpolls',
'vumi-wikipedia',
# We need dev versions of the three packages above, so they have to be
# installed before us. They're listed first so that we fail fast
# instead of working through all the other requirements before
# discovering that they aren't available should that be the case.
'Django==1.5.5',
'django-nose==1.0',
'nose==1.1.2',
'gunicorn==0.15.0',
'South==0.8.2',
'psycopg2==2.4',
'celery==3.0.23',
'django-celery==3.0.23',
'django-celery-email',
'Markdown==2.1.1',
'django-registration==1.0',
'lesscpy==0.9h',
'xlrd==0.8.0',
'requests==0.14.2',
'mock==1.0.1',
'raven>=2.0,<3.0',
'django-debug-toolbar==0.9.4',
'kombu==2.5.6',
'librabbitmq==1.0.1',
'hiredis==0.1.1',
'django-pipeline==1.3.6',
'txpostgres==1.1.0',
'django-crispy-forms==1.4.0',
],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
Expand Down

0 comments on commit 3f2d31d

Please sign in to comment.