Merge lp:~cjwatson/python-oops-amqp/tox into lp:python-oops-amqp

Proposed by Colin Watson
Status: Merged
Merged at revision: 24
Proposed branch: lp:~cjwatson/python-oops-amqp/tox
Merge into: lp:python-oops-amqp
Diff against target: 447 lines (+24/-360)
9 files modified
.bzrignore (+1/-9)
.testr.conf (+0/-4)
Makefile (+0/-13)
NEWS (+5/-0)
README (+2/-16)
bootstrap.py (+0/-259)
buildout.cfg (+0/-38)
tox.ini (+16/-0)
versions.cfg (+0/-21)
To merge this branch: bzr merge lp:~cjwatson/python-oops-amqp/tox
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Review via email: mp+430847@code.launchpad.net

Commit message

Switch from buildout to tox.

To post a comment you must log in.
lp:~cjwatson/python-oops-amqp/tox updated
25. By Colin Watson

Update .bzrignore.

Revision history for this message
Ioana Lasc (ilasc) :
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 11:48:55 +0000
3+++ .bzrignore 2022-09-30 22:49:18 +0000
4@@ -1,12 +1,4 @@
5 __pycache__
6-./eggs/*
7-./.installed.cfg
8-./develop-eggs
9-./bin
10 ./oops_amqp.egg-info
11-./parts
12-./eggs
13-./download-cache
14 ./dist
15-./MANIFEST
16-./.testrepository
17+./.tox
18
19=== removed file '.testr.conf'
20--- .testr.conf 2011-12-08 10:50:34 +0000
21+++ .testr.conf 1970-01-01 00:00:00 +0000
22@@ -1,4 +0,0 @@
23-[DEFAULT]
24-test_command=PYTHONPATH=. bin/py -m subunit.run $LISTOPT $IDOPTION oops_amqp.tests.test_suite
25-test_id_option=--load-list $IDFILE
26-test_list_option=--list
27
28=== removed file 'Makefile'
29--- Makefile 2012-08-10 01:24:50 +0000
30+++ Makefile 1970-01-01 00:00:00 +0000
31@@ -1,13 +0,0 @@
32-all:
33-
34-bin/buildout: buildout.cfg versions.cfg setup.py download-cache eggs
35- ./bootstrap.py \
36- --setup-source=download-cache/ez_setup.py \
37- --download-base=download-cache/dist --eggs=eggs
38-
39-
40-download-cache:
41- bzr checkout --lightweight lp:lp-source-dependencies download-cache
42-
43-eggs:
44- mkdir eggs
45
46=== modified file 'NEWS'
47--- NEWS 2018-05-09 12:31:40 +0000
48+++ NEWS 2022-09-30 22:49:18 +0000
49@@ -3,6 +3,11 @@
50
51 Changes and improvements to oops-amqp, grouped by release.
52
53+0.1.1
54+-----
55+
56+- Switch from buildout to tox. (Colin Watson)
57+
58 0.1.0
59 -----
60
61
62=== modified file 'README'
63--- README 2018-03-12 11:48:18 +0000
64+++ README 2022-09-30 22:49:18 +0000
65@@ -40,8 +40,6 @@
66
67 * rabbitfixture (http://pypi.python.org/pypi/rabbitfixture)
68
69-* subunit (http://pypi.python.org/pypi/python-subunit) (optional)
70-
71 * testresources (http://pypi.python.org/pypi/testresources)
72
73 * testtools (http://pypi.python.org/pypi/testtools)
74@@ -122,17 +120,5 @@
75 ===========
76
77 Upstream development takes place at https://launchpad.net/python-oops-amqp.
78-To setup a working area for development, if the dependencies are not
79-immediately available, you can use ./bootstrap.py to create bin/buildout, then
80-bin/py to get a python interpreter with the dependencies available.
81-
82-To run the tests use the runner of your choice, the test suite is
83-oops_amqp.tests.test_suite.
84-
85-For instance::
86-
87- $ bin/py -m testtools.run oops_amqp.tests.test_suite
88-
89-If you have testrepository you can run the tests with that::
90-
91- $ testr run
92+
93+To run the tests, use ``tox``.
94
95=== removed file 'bootstrap.py'
96--- bootstrap.py 2011-10-10 21:49:50 +0000
97+++ bootstrap.py 1970-01-01 00:00:00 +0000
98@@ -1,259 +0,0 @@
99-#!/usr/bin/env python
100-##############################################################################
101-#
102-# Copyright (c) 2006 Zope Foundation and Contributors.
103-# All Rights Reserved.
104-#
105-# This software is subject to the provisions of the Zope Public License,
106-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
107-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
108-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
109-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
110-# FOR A PARTICULAR PURPOSE.
111-#
112-##############################################################################
113-"""Bootstrap a buildout-based project
114-
115-Simply run this script in a directory containing a buildout.cfg.
116-The script accepts buildout command-line options, so you can
117-use the -c option to specify an alternate configuration file.
118-"""
119-
120-import os, shutil, sys, tempfile, textwrap, urllib, urllib2, subprocess
121-from optparse import OptionParser
122-
123-if sys.platform == 'win32':
124- def quote(c):
125- if ' ' in c:
126- return '"%s"' % c # work around spawn lamosity on windows
127- else:
128- return c
129-else:
130- quote = str
131-
132-# See zc.buildout.easy_install._has_broken_dash_S for motivation and comments.
133-stdout, stderr = subprocess.Popen(
134- [sys.executable, '-Sc',
135- 'try:\n'
136- ' import ConfigParser\n'
137- 'except ImportError:\n'
138- ' print 1\n'
139- 'else:\n'
140- ' print 0\n'],
141- stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()
142-has_broken_dash_S = bool(int(stdout.strip()))
143-
144-# In order to be more robust in the face of system Pythons, we want to
145-# run without site-packages loaded. This is somewhat tricky, in
146-# particular because Python 2.6's distutils imports site, so starting
147-# with the -S flag is not sufficient. However, we'll start with that:
148-if not has_broken_dash_S and 'site' in sys.modules:
149- # We will restart with python -S.
150- args = sys.argv[:]
151- args[0:0] = [sys.executable, '-S']
152- args = map(quote, args)
153- os.execv(sys.executable, args)
154-# Now we are running with -S. We'll get the clean sys.path, import site
155-# because distutils will do it later, and then reset the path and clean
156-# out any namespace packages from site-packages that might have been
157-# loaded by .pth files.
158-clean_path = sys.path[:]
159-import site
160-sys.path[:] = clean_path
161-for k, v in sys.modules.items():
162- if (hasattr(v, '__path__') and
163- len(v.__path__)==1 and
164- not os.path.exists(os.path.join(v.__path__[0],'__init__.py'))):
165- # This is a namespace package. Remove it.
166- sys.modules.pop(k)
167-
168-is_jython = sys.platform.startswith('java')
169-
170-setuptools_source = 'http://peak.telecommunity.com/dist/ez_setup.py'
171-distribute_source = 'http://python-distribute.org/distribute_setup.py'
172-
173-# parsing arguments
174-def normalize_to_url(option, opt_str, value, parser):
175- if value:
176- if '://' not in value: # It doesn't smell like a URL.
177- value = 'file://%s' % (
178- urllib.pathname2url(
179- os.path.abspath(os.path.expanduser(value))),)
180- if opt_str == '--download-base' and not value.endswith('/'):
181- # Download base needs a trailing slash to make the world happy.
182- value += '/'
183- else:
184- value = None
185- name = opt_str[2:].replace('-', '_')
186- setattr(parser.values, name, value)
187-
188-usage = '''\
189-[DESIRED PYTHON FOR BUILDOUT] bootstrap.py [options]
190-
191-Bootstraps a buildout-based project.
192-
193-Simply run this script in a directory containing a buildout.cfg, using the
194-Python that you want bin/buildout to use.
195-
196-Note that by using --setup-source and --download-base to point to
197-local resources, you can keep this script from going over the network.
198-'''
199-
200-parser = OptionParser(usage=usage)
201-parser.add_option("-v", "--version", dest="version",
202- help="use a specific zc.buildout version")
203-parser.add_option("-d", "--distribute",
204- action="store_true", dest="use_distribute", default=False,
205- help="Use Distribute rather than Setuptools.")
206-parser.add_option("--setup-source", action="callback", dest="setup_source",
207- callback=normalize_to_url, nargs=1, type="string",
208- help=("Specify a URL or file location for the setup file. "
209- "If you use Setuptools, this will default to " +
210- setuptools_source + "; if you use Distribute, this "
211- "will default to " + distribute_source +"."))
212-parser.add_option("--download-base", action="callback", dest="download_base",
213- callback=normalize_to_url, nargs=1, type="string",
214- help=("Specify a URL or directory for downloading "
215- "zc.buildout and either Setuptools or Distribute. "
216- "Defaults to PyPI."))
217-parser.add_option("--eggs",
218- help=("Specify a directory for storing eggs. Defaults to "
219- "a temporary directory that is deleted when the "
220- "bootstrap script completes."))
221-parser.add_option("-t", "--accept-buildout-test-releases",
222- dest='accept_buildout_test_releases',
223- action="store_true", default=False,
224- help=("Normally, if you do not specify a --version, the "
225- "bootstrap script and buildout gets the newest "
226- "*final* versions of zc.buildout and its recipes and "
227- "extensions for you. If you use this flag, "
228- "bootstrap and buildout will get the newest releases "
229- "even if they are alphas or betas."))
230-parser.add_option("-c", None, action="store", dest="config_file",
231- help=("Specify the path to the buildout configuration "
232- "file to be used."))
233-
234-options, args = parser.parse_args()
235-
236-# if -c was provided, we push it back into args for buildout's main function
237-if options.config_file is not None:
238- args += ['-c', options.config_file]
239-
240-if options.eggs:
241- eggs_dir = os.path.abspath(os.path.expanduser(options.eggs))
242-else:
243- eggs_dir = tempfile.mkdtemp()
244-
245-if options.setup_source is None:
246- if options.use_distribute:
247- options.setup_source = distribute_source
248- else:
249- options.setup_source = setuptools_source
250-
251-if options.accept_buildout_test_releases:
252- args.append('buildout:accept-buildout-test-releases=true')
253-args.append('bootstrap')
254-
255-try:
256- import pkg_resources
257- import setuptools # A flag. Sometimes pkg_resources is installed alone.
258- if not hasattr(pkg_resources, '_distribute'):
259- raise ImportError
260-except ImportError:
261- ez_code = urllib2.urlopen(
262- options.setup_source).read().replace('\r\n', '\n')
263- ez = {}
264- exec ez_code in ez
265- setup_args = dict(to_dir=eggs_dir, download_delay=0)
266- if options.download_base:
267- setup_args['download_base'] = options.download_base
268- if options.use_distribute:
269- setup_args['no_fake'] = True
270- ez['use_setuptools'](**setup_args)
271- reload(sys.modules['pkg_resources'])
272- import pkg_resources
273- # This does not (always?) update the default working set. We will
274- # do it.
275- for path in sys.path:
276- if path not in pkg_resources.working_set.entries:
277- pkg_resources.working_set.add_entry(path)
278-
279-cmd = [quote(sys.executable),
280- '-c',
281- quote('from setuptools.command.easy_install import main; main()'),
282- '-mqNxd',
283- quote(eggs_dir)]
284-
285-if not has_broken_dash_S:
286- cmd.insert(1, '-S')
287-
288-find_links = options.download_base
289-if not find_links:
290- find_links = os.environ.get('bootstrap-testing-find-links')
291-if find_links:
292- cmd.extend(['-f', quote(find_links)])
293-
294-if options.use_distribute:
295- setup_requirement = 'distribute'
296-else:
297- setup_requirement = 'setuptools'
298-ws = pkg_resources.working_set
299-setup_requirement_path = ws.find(
300- pkg_resources.Requirement.parse(setup_requirement)).location
301-env = dict(
302- os.environ,
303- PYTHONPATH=setup_requirement_path)
304-
305-requirement = 'zc.buildout'
306-version = options.version
307-if version is None and not options.accept_buildout_test_releases:
308- # Figure out the most recent final version of zc.buildout.
309- import setuptools.package_index
310- _final_parts = '*final-', '*final'
311- def _final_version(parsed_version):
312- for part in parsed_version:
313- if (part[:1] == '*') and (part not in _final_parts):
314- return False
315- return True
316- index = setuptools.package_index.PackageIndex(
317- search_path=[setup_requirement_path])
318- if find_links:
319- index.add_find_links((find_links,))
320- req = pkg_resources.Requirement.parse(requirement)
321- if index.obtain(req) is not None:
322- best = []
323- bestv = None
324- for dist in index[req.project_name]:
325- distv = dist.parsed_version
326- if _final_version(distv):
327- if bestv is None or distv > bestv:
328- best = [dist]
329- bestv = distv
330- elif distv == bestv:
331- best.append(dist)
332- if best:
333- best.sort()
334- version = best[-1].version
335-if version:
336- requirement = '=='.join((requirement, version))
337-cmd.append(requirement)
338-
339-if is_jython:
340- import subprocess
341- exitcode = subprocess.Popen(cmd, env=env).wait()
342-else: # Windows prefers this, apparently; otherwise we would prefer subprocess
343- exitcode = os.spawnle(*([os.P_WAIT, sys.executable] + cmd + [env]))
344-if exitcode != 0:
345- sys.stdout.flush()
346- sys.stderr.flush()
347- print ("An error occurred when trying to install zc.buildout. "
348- "Look above this message for any errors that "
349- "were output by easy_install.")
350- sys.exit(exitcode)
351-
352-ws.add_entry(eggs_dir)
353-ws.require(requirement)
354-import zc.buildout.buildout
355-zc.buildout.buildout.main(args)
356-if not options.eggs: # clean up temporary egg directory
357- shutil.rmtree(eggs_dir)
358
359=== removed file 'buildout.cfg'
360--- buildout.cfg 2011-12-08 09:29:35 +0000
361+++ buildout.cfg 1970-01-01 00:00:00 +0000
362@@ -1,38 +0,0 @@
363-# Copyright 2011 Canonical Ltd. This software is licensed under the
364-# GNU Lesser General Public License version 3 (see the file LICENSE).
365-
366-[buildout]
367-parts =
368- scripts
369-unzip = true
370-eggs-directory = eggs
371-download-cache = download-cache
372-relative-paths = true
373-
374-# Disable this option temporarily if you want buildout to find software
375-# dependencies *other* than those in our download-cache. Once you have the
376-# desired software, reenable this option (and check in the new software to
377-# lp:lp-source-dependencies if this is going to be reviewed/merged/deployed.)
378-install-from-cache = true
379-
380-# This also will need to be temporarily disabled or changed for package
381-# upgrades. Newly-added packages should also add their desired version number
382-# to versions.cfg.
383-extends = versions.cfg
384-
385-allow-picked-versions = false
386-
387-prefer-final = true
388-
389-develop = .
390-
391-# [configuration]
392-# instance_name = development
393-
394-[scripts]
395-recipe = z3c.recipe.scripts
396-eggs = oops-amqp [test]
397-include-site-packages = true
398-allowed-eggs-from-site-packages =
399- subunit
400-interpreter = py
401
402=== added file 'tox.ini'
403--- tox.ini 1970-01-01 00:00:00 +0000
404+++ tox.ini 2022-09-30 22:49:18 +0000
405@@ -0,0 +1,16 @@
406+[tox]
407+envlist =
408+ py27
409+ py35
410+ py36
411+ py37
412+ py38
413+ py39
414+ py310
415+
416+[testenv]
417+deps =
418+ .[test]
419+ pytest
420+commands =
421+ pytest {posargs}
422
423=== removed file 'versions.cfg'
424--- versions.cfg 2018-03-12 11:48:55 +0000
425+++ versions.cfg 1970-01-01 00:00:00 +0000
426@@ -1,21 +0,0 @@
427-[buildout]
428-versions = versions
429-
430-[versions]
431-amqp = 2.2.2
432-bson = 0.3.2
433-fixtures = 0.3.6
434-iso8601 = 0.1.4
435-oops = 0.0.13
436-pymongo = 2.1.1
437-pytz = 2010o
438-rabbitfixture = 0.3.2
439-setuptools = 0.6c11
440-six = 1.11.0
441-testresources = 0.2.4-r58
442-testtools = 0.9.12-r228
443-vine = 1.1.4
444-zc.recipe.egg = 1.3.2
445-z3c.recipe.filetemplate = 2.1.0
446-z3c.recipe.scripts = 1.0.1
447-zc.buildout = 1.5.1

Subscribers

People subscribed via source and target branches

to all changes: