Merge lp:~lifeless/testtools/version into lp:~testtools-committers/testtools/trunk

Proposed by Robert Collins
Status: Merged
Approved by: Jonathan Lange
Approved revision: not available
Merged at revision: not available
Proposed branch: lp:~lifeless/testtools/version
Merge into: lp:~testtools-committers/testtools/trunk
Diff against target: 64 lines (+28/-2)
3 files modified
HACKING (+1/-1)
setup.py (+13/-1)
testtools/__init__.py (+14/-0)
To merge this branch: bzr merge lp:~lifeless/testtools/version
Reviewer Review Type Date Requested Status
Jonathan Lange Approve
Review via email: mp+15999@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

__version__ can be useful.

Revision history for this message
Jonathan Lange (jml) wrote :

SMASH

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HACKING'
2--- HACKING 2009-12-01 10:04:35 +0000
3+++ HACKING 2009-12-11 05:01:12 +0000
4@@ -112,7 +112,7 @@
5
6 * Choose a version number.
7
8-* Ensure setup.py has that version.
9+* Ensure __init__ has that version.
10
11 * Add a version number to NEWS immediately below NEXT.
12
13
14=== modified file 'setup.py'
15--- setup.py 2009-11-29 00:43:57 +0000
16+++ setup.py 2009-12-11 05:01:12 +0000
17@@ -2,6 +2,18 @@
18 """Distutils installer for testtools."""
19
20 from distutils.core import setup
21+import testtools
22+version = '.'.join(str(component) for component in testtools.__version__[0:3])
23+phase = testtools.__version__[3]
24+if phase != 'final':
25+ import bzrlib.workingtree
26+ t = bzrlib.workingtree.WorkingTree.open_containing(__file__)[0]
27+ if phase == 'alpha':
28+ # No idea what the next version will be
29+ version = 'next-%s' % t.branch.revno()
30+ else:
31+ # Preserve the version number but give it a revno prefix
32+ version = version + '~%s' % t.branch.revno()
33
34 setup(name='testtools',
35 author='Jonathan M. Lange',
36@@ -9,5 +21,5 @@
37 url='https://launchpad.net/testtools',
38 description=('Extensions to the Python standard library unit testing '
39 'framework'),
40- version='0.9.1',
41+ version=version,
42 packages=['testtools'])
43
44=== modified file 'testtools/__init__.py'
45--- testtools/__init__.py 2009-11-21 09:34:58 +0000
46+++ testtools/__init__.py 2009-12-11 05:01:12 +0000
47@@ -42,3 +42,17 @@
48 ConcurrentTestSuite,
49 )
50 from testtools.utils import iterate_tests
51+
52+# same format as sys.version_info: "A tuple containing the five components of
53+# the version number: major, minor, micro, releaselevel, and serial. All
54+# values except releaselevel are integers; the release level is 'alpha',
55+# 'beta', 'candidate', or 'final'. The version_info value corresponding to the
56+# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
57+# releaselevel of 'dev' for unreleased under-development code.
58+#
59+# If the releaselevel is 'alpha' then the major/minor/micro components are not
60+# established at this point, and setup.py will use a version of next-$(revno).
61+# If the releaselevel is 'final', then the tarball will be major.minor.micro.
62+# Otherwise it is major.minor.micro~$(revno).
63+
64+__version__ = (0, 9, 2, 'alpha', 0)

Subscribers

People subscribed via source and target branches