[Pkg-bazaar-commits] r180 ./bzr-builddeb/trunk: Change version_info to be in its own module to make it easily testable.

James Westby jw+debian at jameswestby.net
Fri Sep 21 17:38:14 UTC 2007


------------------------------------------------------------
revno: 180
committer: James Westby <jw+debian at jameswestby.net>
branch nick: trunk
timestamp: Fri 2007-09-21 18:38:14 +0100
message:
  Change version_info to be in its own module to make it easily testable.
added:
  version.py
modified:
  __init__.py
  tests/test_version.py
-------------- next part --------------
=== added file 'version.py'
--- a/version.py	1970-01-01 00:00:00 +0000
+++ b/version.py	2007-09-21 17:38:14 +0000
@@ -0,0 +1,29 @@
+#    version.py -- Defines the version of builddeb.
+#    Copyright (C) 2007 James Westby <jw+debian at jameswestby.net>
+#    
+#    This file is part of bzr-builddeb.
+#
+#    bzr-builddeb is free software; you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation; either version 2 of the License, or
+#    (at your option) any later version.
+#
+#    bzr-builddeb is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with bzr-builddeb; if not, write to the Free Software
+#    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+# same format as sys.version_info: "A tuple containing the five components of
+# the version number: major, minor, micro, releaselevel, and serial. All
+# values except releaselevel are integers; the release level is 'alpha',
+# 'beta', 'candidate', or 'final'. The version_info value corresponding to the
+# Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
+# releaselevel of 'dev' for unreleased under-development code.
+#
+# Please set this to 'final' before upload.
+version_info = (0, 91, 0, 'dev', 0)

=== modified file '__init__.py'
--- a/__init__.py	2007-09-12 20:57:04 +0000
+++ b/__init__.py	2007-09-21 17:38:14 +0000
@@ -44,17 +44,7 @@
                     )
 from properties import BuildProperties
 from util import goto_branch, find_changelog, tarball_name
-
-
-# same format as sys.version_info: "A tuple containing the five components of
-# the version number: major, minor, micro, releaselevel, and serial. All
-# values except releaselevel are integers; the release level is 'alpha',
-# 'beta', 'candidate', or 'final'. The version_info value corresponding to the
-# Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
-# releaselevel of 'dev' for unreleased under-development code.
-#
-# Please set this to 'final' before upload.
-version_info = (0, 91, 0, 'dev', 0)
+from version import version_info
 
 
 dont_purge_opt = Option('dont-purge',

=== modified file 'tests/test_version.py'
--- a/tests/test_version.py	2007-09-12 20:57:04 +0000
+++ b/tests/test_version.py	2007-09-21 17:38:14 +0000
@@ -18,7 +18,7 @@
 #    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #
 
-from bzrlib.plugins import builddeb
+import version
 
 import bzrlib
 from bzrlib.tests import TestCase, KnownFailure
@@ -28,6 +28,6 @@
 
   def test_version_matches(self):
     """An abused test case to warn when the version doesn't match bzrlib."""
-    if builddeb.version_info != bzrlib.version_info:
+    if version.version_info != bzrlib.version_info:
       raise KnownFailure("builddeb version doesn't match bzrlib version")
 



More information about the Pkg-bazaar-commits mailing list