Browse Source

Stop setting version manually

One of the reasons that pbr exists is to have versions be driven by
signed git tags instead of by content in the source repository. This has
the benefit of being both easier and preventing people from forgetting
to push a git tag when they cut a release.

Additionally, this code is doesn't work for sdist jobs in Zuul upstream
because it requires the project to be importable to run setup.py, but
sdist/wheel generation does not otherwise need to install dependencies.

Remove the override of version in setup.py and replace the hard-coded
version string in oslogmerger.py with the appropriate pbr code.

Change-Id: Ifdbb649b02d7e2fde6e8682e138c81817543fb08
Monty Taylor 9 months ago
parent
commit
44d81d873e
No account linked to committer's email address
3 changed files with 3 additions and 3 deletions
  1. 2
    1
      oslogmerger/oslogmerger.py
  2. 1
    0
      requirements.txt
  3. 0
    2
      setup.py

+ 2
- 1
oslogmerger/oslogmerger.py View File

@@ -13,8 +13,9 @@ import time
13 13
 import dateutil.parser
14 14
 import dateutil.tz
15 15
 from six.moves.urllib.request import urlopen
16
+import pbr.version
16 17
 
17
-__version__ = '1.1.1'
18
+__version__ = pbr.version.VersionInfo('os-log-merger').version_string()
18 19
 
19 20
 EXTRALINES_PADDING = " " * 40
20 21
 CACHE_DIR = "%s/oslogmerger-cache/" % tempfile.gettempdir()

+ 1
- 0
requirements.txt View File

@@ -1,2 +1,3 @@
1
+pbr
1 2
 python-dateutil
2 3
 six

+ 0
- 2
setup.py View File

@@ -1,8 +1,6 @@
1 1
 from setuptools import setup
2
-from oslogmerger.oslogmerger import __version__
3 2
 
4 3
 setup(
5
-    version=__version__,
6 4
     setup_requires=['pbr>=2.0.0'],
7 5
     pbr=True,
8 6
 )

Loading…
Cancel
Save