Merge ~harlowja/cloud-init:scm-version into cloud-init:master

Proposed by Joshua Harlow
Status: Rejected
Rejected by: Scott Moser
Proposed branch: ~harlowja/cloud-init:scm-version
Merge into: cloud-init:master
Diff against target: 41 lines (+4/-9)
3 files modified
cloudinit/version.py (+1/-9)
requirements.txt (+1/-0)
setup.py (+2/-0)
Reviewer Review Type Date Requested Status
cloud-init Commiters Pending
Review via email: mp+301727@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

This would be runtime dependency, right?
i'd really rather not take that.

I'm not opposed to this and woudl like version information to follow *some* standard.

what i have now is just what comes out of git describe modified a bit.

see tools/make-tarball

# revname could be 0.7.5 or 0.7.5-NNN-gHASH
# turn that into 0.7.5 or 0.7.5+NNN.gHASH

that currently shows:
  0.7.6+1026-gef54bea

python -c 'from setuptools_scm import get_version; print(get_version())'
shows
  0.7.7.dev1023+ng72d6adc

is .dev1023+ngHASH
better in some way ?

Revision history for this message
Joshua Harlow (harlowja) wrote :

I guess the only thing that I can think about that makes using these tools useful is that they can provide a consistent way of getting that version (instead of yet another one-off way of getting it); pbr also has the nice ability to generate a debian version string and a redhat version string, which are quite useful when actually creating a package.

For example:

$ python setup.py rpm_version
running rpm_version
[pbr] Extracting rpm version
1.32.0.dev6

Not quite sure where the pbr output for deb_version is (thought it had this, ha).

That's usually the next question, ok, now that we have a version string crap here, well now I need a debian version of that string and I need a redhat version of that string.

Revision history for this message
Joshua Harlow (harlowja) wrote :

So https://review.openstack.org/#/c/350861 is the addition to pbr for the 'deb version' so this imho makes me lean towards using pbr vs this package, and using either over a custom hand rolled version calculation scheme. Because with a hand rolled scheme, I'll still need to be translating the output of that hand rolled scheme into a RPM compatible form, which means, at that point a automatic version derived from git isn't offering that much value (because a human still needs to translate it) :(

Revision history for this message
Scott Moser (smoser) wrote :

So In my head, here are the things that i need to cover:

a.) export of release tarball
b.) export of snapshot tarball
c.) upstream package build (./packages/brpm and ./package/bddeb)
    this basically does a export of a snapshot tarball and then build with local packaging.

d.) smoser upload to ubuntu of snapshot supporting build on 14.04+
    smoser does 'export of snapshot tarball'
    smoser adds a debian/changelog entry (which requires a debian sufficient version)

e.) i really would like for cloud-init runtime to show the "upstream version" in its greeting (the hole thing, not just 0.7.7).

In bzr, i would do http://bazaar.launchpad.net/~smoser/ubuntu/xenial/cloud-init/pkg/view/head:/debian/new-upstream-snapshot and it would handle it all.

The key things this all means i think are
1.) I don't want to require some new pip installed version of a package in order to build a tarball (i want to be able to do that on 14.04)
2.) there is an 'upstream' version that is basically then translated to debian and rpm versions.
3.) i don't want / can't have some new version of pbr installed in 14.04 on official build systems.
4.) i definitely can't pick up a runtime dependency to simply translate
    0.7.6-1023-g72d6adc to 0.7.6+1023-g72d6adc

Thoughts?

Revision history for this message
Scott Moser (smoser) wrote :

oh, just want to point out that yes, i also want the most standard package versioning i can get (although i think there are no standard package versions in reality, but pbr seems to have hopes of getting there at least).

Revision history for this message
Scott Moser (smoser) wrote :

the needed functionality is now in trunk via usage of tools/read-version.

Unmerged commits

cc78be5... by Joshua Harlow

Use 'setuptools_scm' for version string creation

This package, supported by the pypa community allows
for gathering of version information from git itself
so using it allows for dynamic version creation in a
hopefully stable manner, which can then be used by
package builders (and more).

a7a6ed2... by Joshua Harlow

Use 'setuptools_scm' to determine current version (from scm)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/cloudinit/version.py b/cloudinit/version.py
2index 3d1d1d2..4fc958c 100644
3--- a/cloudinit/version.py
4+++ b/cloudinit/version.py
5@@ -16,12 +16,4 @@
6 # You should have received a copy of the GNU General Public License
7 # along with this program. If not, see <http://www.gnu.org/licenses/>.
8
9-from distutils import version as vr
10-
11-
12-def version():
13- return vr.StrictVersion("0.7.7")
14-
15-
16-def version_string():
17- return str(version())
18+from setuptools_scm import get_version as version_string
19diff --git a/requirements.txt b/requirements.txt
20index cc1dc05..b5a4ef2 100644
21--- a/requirements.txt
22+++ b/requirements.txt
23@@ -1,4 +1,5 @@
24 # Pypi requirements for cloud-init to work
25+setuptools_scm
26
27 # Used for untemplating any files or strings with parameters.
28 jinja2
29diff --git a/setup.py b/setup.py
30index 0af576a..b07d0d2 100755
31--- a/setup.py
32+++ b/setup.py
33@@ -209,6 +209,8 @@ setuptools.setup(
34 data_files=data_files,
35 install_requires=requirements,
36 cmdclass=cmdclass,
37+ use_scm_version=True,
38+ setup_requires=['setuptools_scm'],
39 entry_points={
40 'console_scripts': [
41 'cloud-init = cloudinit.cmd.main:main'

Subscribers

People subscribed via source and target branches