Merge lp:~cjwatson/python-oops-datedir-repo/replace-buildout into lp:python-oops-datedir-repo

Proposed by Colin Watson
Status: Merged
Merged at revision: 59
Proposed branch: lp:~cjwatson/python-oops-datedir-repo/replace-buildout
Merge into: lp:python-oops-datedir-repo
Diff against target: 159 lines (+82/-25)
6 files modified
.bzrignore (+6/-9)
Makefile (+40/-0)
NEWS (+1/-0)
README (+7/-16)
requirements.txt (+17/-0)
tox.ini (+11/-0)
To merge this branch: bzr merge lp:~cjwatson/python-oops-datedir-repo/replace-buildout
Reviewer Review Type Date Requested Status
Tom Wardill (community) Approve
Review via email: mp+405642@code.launchpad.net

Commit message

Replace zc.buildout with virtualenv, pip, and tox.

Description of the change

The version of zc.buildout that we were using no longer works with current PyPI. Replace it with virtualenv and pip (for production) and tox (for testing). Some setup gymnastics were necessary because we currently have this deployed on Ubuntu 12.04, whose virtualenv and pip are very old.

I had to apply a few requirement upgrades relative to the previous contents of versions.cfg, since some of those versions didn't exist on PyPI, or in the case of pytz the old version numbering scheme confused pip. These upgrades, which all seem innocuous, are:

 * bson 0.3.2 → 0.3.4
 * httplib2 0.6.0 → 0.7.3
 * launchpadlib 1.9.9 → 1.10.2
 * lazr.authentication 0.1.1 → 0.1.3
 * lazr.restfulclient 0.12.1 → 0.12.2
 * lazr.uri 1.0.2 → 1.0.3
 * pytz 2011n → 2021.1
 * wadllib 1.2.0 → 1.3.2

To post a comment you must log in.
Revision history for this message
Tom Wardill (twom) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2018-03-12 12:06:11 +0000
3+++ .bzrignore 2021-07-13 16:33:14 +0000
4@@ -1,13 +1,10 @@
5+*.pyc
6 __pycache__
7-./eggs/*
8-./.installed.cfg
9-./develop-eggs
10+./*.egg-info
11+./.tox
12 ./bin
13-./oops_datedir_repo.egg-info
14-./parts
15-./eggs
16-./download-cache
17+./build
18 ./dist
19+./env
20 ./MANIFEST
21-.testrepository
22-./build
23+./tmp
24
25=== added file 'Makefile'
26--- Makefile 1970-01-01 00:00:00 +0000
27+++ Makefile 2021-07-13 16:33:14 +0000
28@@ -0,0 +1,40 @@
29+SERVICE_PACKAGE = oops_datedir_repo
30+ENV = $(CURDIR)/env
31+PIP = $(ENV)/bin/pip
32+TMPDIR = $(CURDIR)/tmp
33+TESTS ?= $(SERVICE_PACKAGE).tests.test_suite
34+
35+DEPENDENCY_REPO ?= https://git.launchpad.net/~launchpad/python-oops-datedir-repo/+git/dependencies
36+DEPENDENCY_DIR ?= $(TMPDIR)/dependencies
37+
38+
39+$(ENV)/.created: | $(DEPENDENCY_DIR)
40+ VIRTUALENV_SETUPTOOLS=1 virtualenv $(ENV) --python=python2
41+ ln -sfn env/bin bin
42+ $(PIP) install -f file://$(DEPENDENCY_DIR) --no-index pip==20.0.2
43+ $(PIP) install -f file://$(DEPENDENCY_DIR) --no-index \
44+ setuptools==44.0.0 wheel==0.34.2
45+ $(PIP) install -f file://$(DEPENDENCY_DIR) --no-index pbr==5.6.0
46+ $(PIP) install -f file://$(DEPENDENCY_DIR) --no-index \
47+ -r requirements.txt -e .
48+ @touch $@
49+
50+$(DEPENDENCY_DIR):
51+ git clone $(DEPENDENCY_REPO) $(DEPENDENCY_DIR)
52+
53+update-dependencies: $(DEPENDENCY_DIR)
54+ cd $(DEPENDENCY_DIR) && git pull $(DEPENDENCY_REPO)
55+
56+bootstrap build: $(ENV)/.created
57+
58+check:
59+ tox
60+
61+clean:
62+ rm -rf $(ENV) .tox
63+ rm -rf $(TMPDIR)
64+ rm -f bin
65+ find -name '__pycache__' -print0 | xargs -0 rm -rf
66+ find -name '*.~*' -delete
67+
68+.PHONY: update-dependencies check clean
69
70=== modified file 'NEWS'
71--- NEWS 2021-07-12 09:53:27 +0000
72+++ NEWS 2021-07-13 16:33:14 +0000
73@@ -8,6 +8,7 @@
74
75 * Bump lazr.restfulclient to 0.12.1 to pull in the fix for #1401544, now
76 required by Launchpad when running on gunicorn.
77+* Replace zc.buildout with virtualenv, pip, and tox.
78
79 0.0.24
80 ------
81
82=== modified file 'README'
83--- README 2012-09-26 06:35:34 +0000
84+++ README 2021-07-13 16:33:14 +0000
85@@ -66,25 +66,16 @@
86 Installation
87 ============
88
89-Either run setup.py in an environment with all the dependencies available, or
90-add the working directory to your PYTHONPATH.
91+oops_datedir_repo can be installed into an existing Python environment in
92+the usual way using ``pip``, or it can be installed as a standalone package
93+in order to use its ``prune`` tool. To install it as a standalone package,
94+run ``make`` to create a suitable virtual environment; you can then run
95+``bin/prune`` to delete unreferenced OOPSes.
96
97
98 Development
99 ===========
100
101 Upstream development takes place at https://launchpad.net/python-oops-datedir-repo.
102-To setup a working area for development, if the dependencies are not
103-immediately available, you can use ./bootstrap.py to create bin/buildout, then
104-bin/py to get a python interpreter with the dependencies available.
105-
106-To run the tests use the runner of your choice, the test suite is
107-oops_datedir_repo.tests.test_suite.
108-
109-For instance::
110-
111- $ bin/py -m testtools.run oops_datedir_repo.tests.test_suite
112-
113-If you have testrepository you can run the tests with that::
114-
115- $ testr run
116+
117+To run this project's tests, use `tox <https://tox.readthedocs.io/en/latest/>`.
118
119=== removed file 'bootstrap.py'
120=== removed file 'buildout.cfg'
121=== added file 'requirements.txt'
122--- requirements.txt 1970-01-01 00:00:00 +0000
123+++ requirements.txt 2021-07-13 16:33:14 +0000
124@@ -0,0 +1,17 @@
125+bson==0.3.4
126+httplib2==0.7.3
127+iso8601==0.1.4
128+keyring==0.6.2
129+launchpadlib==1.10.2
130+lazr.authentication==0.1.3
131+lazr.restfulclient==0.12.2
132+lazr.uri==1.0.3
133+oauth==1.0
134+oops==0.0.13
135+pytz==2021.1
136+simplejson==2.1.3
137+six==1.11.0
138+testresources==2.0.1
139+wadllib==1.3.2
140+wsgi-intercept==0.4
141+zope.interface==3.8.0
142
143=== added file 'tox.ini'
144--- tox.ini 1970-01-01 00:00:00 +0000
145+++ tox.ini 2021-07-13 16:33:14 +0000
146@@ -0,0 +1,11 @@
147+[tox]
148+envlist =
149+ py27
150+
151+[testenv]
152+deps =
153+ -r requirements.txt
154+ .[test]
155+ zope.testrunner
156+commands =
157+ zope-testrunner --tests-pattern ^tests {posargs}
158
159=== removed file 'versions.cfg'

Subscribers

People subscribed via source and target branches

to all changes: