← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging lp:~cjwatson/python-oops-datedir-repo/replace-buildout into lp:python-oops-datedir-repo.

Commit message:
Replace zc.buildout with virtualenv, pip, and tox.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/python-oops-datedir-repo/replace-buildout/+merge/405642

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
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/python-oops-datedir-repo/replace-buildout into lp:python-oops-datedir-repo.
=== modified file '.bzrignore'
--- .bzrignore	2018-03-12 12:06:11 +0000
+++ .bzrignore	2021-07-13 16:24:55 +0000
@@ -1,13 +1,10 @@
+*.pyc
 __pycache__
-./eggs/*
-./.installed.cfg
-./develop-eggs
+./*.egg-info
+./.tox
 ./bin
-./oops_datedir_repo.egg-info
-./parts
-./eggs
-./download-cache
+./build
 ./dist
+./env
 ./MANIFEST
-.testrepository
-./build
+./tmp

=== added file 'Makefile'
--- Makefile	1970-01-01 00:00:00 +0000
+++ Makefile	2021-07-13 16:24:55 +0000
@@ -0,0 +1,40 @@
+SERVICE_PACKAGE = oops_datedir_repo
+ENV = $(CURDIR)/env
+PIP = $(ENV)/bin/pip
+TMPDIR = $(CURDIR)/tmp
+TESTS ?= $(SERVICE_PACKAGE).tests.test_suite
+
+DEPENDENCY_REPO ?= https://git.launchpad.net/~launchpad/python-oops-datedir-repo/+git/dependencies
+DEPENDENCY_DIR ?= $(TMPDIR)/dependencies
+
+
+$(ENV)/.created: | $(DEPENDENCY_DIR)
+	VIRTUALENV_SETUPTOOLS=1 virtualenv $(ENV) --python=python2
+	ln -sfn env/bin bin
+	$(PIP) install -f file://$(DEPENDENCY_DIR) --no-index pip==20.0.2
+	$(PIP) install -f file://$(DEPENDENCY_DIR) --no-index \
+		setuptools==44.0.0 wheel==0.34.2
+	$(PIP) install -f file://$(DEPENDENCY_DIR) --no-index pbr==5.6.0
+	$(PIP) install -f file://$(DEPENDENCY_DIR) --no-index \
+		-r requirements.txt -e .
+	@touch $@
+
+$(DEPENDENCY_DIR):
+	git clone $(DEPENDENCY_REPO) $(DEPENDENCY_DIR)
+
+update-dependencies: $(DEPENDENCY_DIR)
+	cd $(DEPENDENCY_DIR) && git pull $(DEPENDENCY_REPO)
+
+bootstrap build: $(ENV)/.created
+
+check:
+	tox
+
+clean:
+	rm -rf $(ENV) .tox
+	rm -rf $(TMPDIR)
+	rm -f bin
+	find -name '__pycache__' -print0 | xargs -0 rm -rf
+	find -name '*.~*' -delete
+
+.PHONY: update-dependencies check clean

=== modified file 'NEWS'
--- NEWS	2021-07-12 09:53:27 +0000
+++ NEWS	2021-07-13 16:24:55 +0000
@@ -8,6 +8,7 @@
 
 * Bump lazr.restfulclient to 0.12.1 to pull in the fix for #1401544, now
   required by Launchpad when running on gunicorn.
+* Replace zc.buildout with virtualenv, pip, and tox.
 
 0.0.24
 ------

=== modified file 'README'
--- README	2012-09-26 06:35:34 +0000
+++ README	2021-07-13 16:24:55 +0000
@@ -66,25 +66,16 @@
 Installation
 ============
 
-Either run setup.py in an environment with all the dependencies available, or
-add the working directory to your PYTHONPATH.
+oops_datedir_repo can be installed into an existing Python environment in
+the usual way using ``pip``, or it can be installed as a standalone package
+in order to use its ``prune`` tool.  To install it as a standalone package,
+run ``make`` to create a suitable virtual environment; you can then run
+``bin/prune`` to delete unreferenced OOPSes.
 
 
 Development
 ===========
 
 Upstream development takes place at https://launchpad.net/python-oops-datedir-repo.
-To setup a working area for development, if the dependencies are not
-immediately available, you can use ./bootstrap.py to create bin/buildout, then
-bin/py to get a python interpreter with the dependencies available.
-
-To run the tests use the runner of your choice, the test suite is
-oops_datedir_repo.tests.test_suite.
-
-For instance::
-
-  $ bin/py -m testtools.run oops_datedir_repo.tests.test_suite
-
-If you have testrepository you can run the tests with that::
-
-  $ testr run
+
+To run this project's tests, use `tox <https://tox.readthedocs.io/en/latest/>`.

=== removed file 'bootstrap.py'
=== removed file 'buildout.cfg'
=== added file 'requirements.txt'
--- requirements.txt	1970-01-01 00:00:00 +0000
+++ requirements.txt	2021-07-13 16:24:55 +0000
@@ -0,0 +1,17 @@
+bson==0.3.4
+httplib2==0.7.3
+iso8601==0.1.4
+keyring==0.6.2
+launchpadlib==1.10.2
+lazr.authentication==0.1.3
+lazr.restfulclient==0.12.2
+lazr.uri==1.0.3
+oauth==1.0
+oops==0.0.13
+pytz==2021.1
+simplejson==2.1.3
+six==1.11.0
+testresources==2.0.1
+wadllib==1.3.2
+wsgi-intercept==0.4
+zope.interface==3.8.0

=== added file 'tox.ini'
--- tox.ini	1970-01-01 00:00:00 +0000
+++ tox.ini	2021-07-13 16:24:55 +0000
@@ -0,0 +1,11 @@
+[tox]
+envlist =
+    py27
+
+[testenv]
+deps =
+    -r requirements.txt
+    .[test]
+    zope.testrunner
+commands =
+    zope-testrunner --tests-pattern ^tests {posargs}

=== removed file 'versions.cfg'