Skip to content

Commit 98b4b04

Browse files
committedMay 29, 2013
[ckan#491] Pin every dependency's exact version.
To create these files, I've used pip-dump from the pip-tools package. All requirements in *-requirements.txt have their versions pinned, and in setup.py we keep only our direct dependencies and with the versions that should work (i.e. >=0.11). We did this so we can guarantee that everyone is using the exact same version as everybody else, including our deployments. For more info, check http://nvie.com/posts/pin-your-packages/.
1 parent 13d4cae commit 98b4b04

12 files changed

+108
-55
lines changed
 

‎CONTRIBUTING.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ To edit these docs:
162162
2. Install the Python dependencies necessary for building the CKAN docs into
163163
your virtualenv::
164164

165-
pip install -r pyenv/src/ckan/pip-requirements-docs.txt
165+
pip install -r pyenv/src/ckan/dev-requirements.txt
166166

167167
3. Fetch the git submodule that contains CKAN's custom Sphinx theme::
168168

‎LICENSE.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Note
2222
====
2323

2424
CKAN is sometimes packaged directly with other software (listed in
25-
pip-requirements.txt, pip-requirements-test.txt and pip-requirements-docs.txt).
25+
requirements.txt and dev-requirements.txt).
2626
In these cases, we are required to list the licenses of the packaged softare
2727
too. They are all AGPL compatible and read as follows in the next sections.
2828

‎bin/travis-build

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ sudo -u postgres psql -c "CREATE USER readonlyuser WITH PASSWORD 'pass';"
2323
sudo -u postgres psql -c 'CREATE DATABASE ckan_test WITH OWNER ckanuser;'
2424
sudo -u postgres psql -c 'CREATE DATABASE ckan_test_datastore WITH OWNER ckanuser;'
2525

26-
pip install -r pip-requirements.txt --use-mirrors
27-
pip install -r pip-requirements-test.txt --use-mirrors
26+
pip install -r requirements.txt -r dev-requirements.txt --use-mirrors
2827

2928
python setup.py develop
3029

‎dev-requirements.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# These are packages that required when running ckan tests
2+
-e git+https://github.com/okfn/ckanclient@a315a72eef74dda4831acd022ef84a1246803c73#egg=ckanclient-dev
3+
docutils==0.8.1
4+
httpretty==0.5
5+
nose==1.2.1
6+
pip-tools==0.3.1
7+
Sphinx==1.2b1

‎doc/install-from-source.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ b. Install the CKAN source code into your virtualenv. To install the latest
6565

6666
c. Install the Python modules that CKAN requires into your virtualenv::
6767

68-
pip install -r ~/pyenv/src/ckan/pip-requirements.txt
68+
pip install -r ~/pyenv/src/ckan/requirements.txt
6969

7070
d. Deactivate and reactivate your virtualenv, to make sure you're using the
7171
virtualenv's copies of commands like ``paster`` rather than any system-wide
@@ -288,7 +288,7 @@ Upgrade a source install
288288

289289
4. Update CKAN's dependencies::
290290

291-
pip install --upgrade -r pip-requirements.txt
291+
pip install --upgrade -r requirements.txt
292292

293293
5. If you are upgrading to a new major version of CKAN (for example if you are
294294
upgrading to CKAN 2.0, 2.1 etc.), then you need to update your Solr schema

‎doc/test.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ virtual environment::
2020
Install nose and other test-specific CKAN dependencies into your virtual
2121
environment::
2222

23-
pip install -r ~/pyenv/src/ckan/pip-requirements-test.txt
23+
pip install -r ~/pyenv/src/ckan/dev-requirements.txt
2424

2525
Testing with SQLite
2626
-------------------

‎fabfile.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
env.base_dir = os.getcwd() # e.g. /home/jsmith/var/srvc
7676
env.local_backup_dir = os.path.expanduser('~/db_backup')
7777
env.ckan_repo = 'https://github.com/okfn/ckan/raw/%s/'
78-
pip_requirements = 'pip-requirements.txt'
78+
pip_requirements = 'requirements.txt'
7979
env.skip_setup_db = False
8080

8181
def config_local(base_dir, ckan_instance_name, db_user=None, db_host=None,
@@ -241,8 +241,8 @@ def deploy():
241241
pip_req = env.ckan_repo % env.revision + pip_requirements
242242
with cd(env.instance_path):
243243

244-
# get latest pip-requirements.txt
245-
print 'Getting pip-requirements from revision: %s' % env.revision
244+
# get latest requirements.txt
245+
print 'Getting requirements from revision: %s' % env.revision
246246
latest_pip_file = urllib2.urlopen(pip_req)
247247
tmp_pip_requirements_filepath = os.path.join('/tmp', pip_requirements)
248248
local_pip_file = open(tmp_pip_requirements_filepath, 'w')

‎pip-requirements-docs.txt

-3
This file was deleted.

‎pip-requirements-test.txt

-6
This file was deleted.

‎pip-requirements.txt

-32
This file was deleted.

‎requirements.txt

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# a Python virtual environment) after you have installed CKAN, with a command
2+
# instructions in CKAN's documentation for full installation instructions.
3+
# like: pip install -r requirements.txt. See the Install from Source
4+
# This file lists CKAN's dependencies so that you can install them (e.g. into
5+
-e git+https://github.com/okfn/vdm.git@e4a59e2b7d3f918a160f21f0d9face29e864a3ce#egg=vdm-dev
6+
apachemiddleware==0.1.1
7+
Babel==0.9.6
8+
Beaker==1.6.4
9+
decorator==3.4.0
10+
fanstatic==0.12
11+
FormAlchemy==1.4.2
12+
FormEncode==1.2.6
13+
Genshi==0.6
14+
Jinja2==2.6
15+
Mako==0.7.3
16+
MarkupSafe==0.15
17+
ofs==0.4.1
18+
Pairtree==0.7.1-T
19+
Paste==1.7.5.1
20+
PasteDeploy==1.5.0
21+
PasteScript==1.7.5
22+
psycopg2==2.4.5
23+
Pygments==1.6
24+
Pylons==0.9.7
25+
python-dateutil==1.5
26+
python-openid==2.2.5
27+
pyutilib.component.core==4.5.3
28+
repoze.lru==0.6
29+
repoze.who-friendlyform==1.0.8
30+
repoze.who.plugins.openid==0.5.3
31+
repoze.who==1.0.19
32+
requests==1.1.0
33+
Routes==1.13
34+
simplejson==3.1.2
35+
solrpy==0.9.5
36+
sqlalchemy-migrate==0.7.2
37+
SQLAlchemy==0.7.8
38+
Tempita==0.5.1
39+
verlib==0.1
40+
virtualenv==1.9.1
41+
WebError==0.10.3
42+
WebHelpers==1.3
43+
WebOb==1.0.8
44+
WebTest==1.4.3
45+
zope.interface==4.0.1

‎setup.py

+47-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,51 @@
77

88
from ckan import __version__, __description__, __long_description__, __license__
99

10+
install_requires = [
11+
'Genshi==0.6',
12+
'Jinja2>=2.6',
13+
'Pylons==0.9.7',
14+
'WebTest==1.4.3', # need to pin this so that Pylons does not install a newer version that conflicts with WebOb==1.0.8
15+
'apachemiddleware>=0.1.1',
16+
'babel>=0.9.6',
17+
'fanstatic==0.12',
18+
'formalchemy>=1.4.2',
19+
'markupsafe>=0.15',
20+
'ofs>=0.4.1',
21+
'pairtree>=0.7.1-T',
22+
'paste>=1.7.5.1',
23+
'psycopg2==2.4.5',
24+
'python-dateutil>=1.5.0,<2.0.0',
25+
'pyutilib.component.core>=4.5.3',
26+
'repoze.who-friendlyform>=1.0.8',
27+
'repoze.who.plugins.openid>=0.5.3',
28+
'repoze.who==1.0.19',
29+
'requests==1.1.0',
30+
'routes>=1.13',
31+
'solrpy>=0.9.5',
32+
'sqlalchemy-migrate>=0.7.2',
33+
'sqlalchemy==0.7.8',
34+
'tempita>=0.5.1',
35+
'vdm>=0.11',
36+
'webhelpers>=1.3',
37+
'webob==1.0.8',
38+
'zope.interface>=4.0.1',
39+
]
40+
41+
dev_requires = [
42+
'ckanclient>=0.10',
43+
'docutils>=0.8.1',
44+
'httpretty>=0.5',
45+
'nose>=1.2.1',
46+
'pip-tools>=0.3.1',
47+
'Sphinx>=1.2b1'
48+
]
49+
50+
dependency_links = [
51+
'https://github.com/okfn/ckanclient/tarball/master#egg=ckanclient'
52+
'https://github.com/okfn/vdm/tarball/master#egg=vdm'
53+
]
54+
1055
setup(
1156
name='ckan',
1257
version=__version__,
@@ -17,10 +62,8 @@
1762
description=__description__,
1863
keywords='data packaging component tool server',
1964
long_description =__long_description__,
20-
install_requires=[
21-
],
22-
extras_require = {
23-
},
65+
install_requires=install_requires,
66+
extra_requires={'dev': dev_requires},
2467
zip_safe=False,
2568
packages=find_packages(exclude=['ez_setup']),
2669
namespace_packages=['ckanext', 'ckanext.stats'],

0 commit comments

Comments
 (0)
Please sign in to comment.