Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong version number in release #422

Closed
ArchangeGabriel opened this issue Oct 31, 2019 · 9 comments
Closed

Wrong version number in release #422

ArchangeGabriel opened this issue Oct 31, 2019 · 9 comments
Labels
Expected Behaviour Bug report of intended functionality

Comments

@ArchangeGabriel
Copy link

(Follow-up of #420)

Recent changes induced this at building time from Github release tarball:

Traceback (most recent call last):
  File "setup.py", line 28, in <module>
    'scripts/accuraterip-checksum',
  File "/usr/lib/python2.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
    _setup_distribution = dist = klass(attrs)
  File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 446, in __init__
    k: v for k, v in attrs.items()
  File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "/usr/lib/python2.7/site-packages/setuptools/dist.py", line 734, in finalize_options
    ep.load()(self, ep.name, value)
  File "/build/whipper/src/whipper-0.8.0/.eggs/setuptools_scm-3.3.3-py2.7.egg/setuptools_scm/integration.py", line 17, in version_keyword
    dist.metadata.version = get_version(**value)
  File "/build/whipper/src/whipper-0.8.0/.eggs/setuptools_scm-3.3.3-py2.7.egg/setuptools_scm/__init__.py", line 150, in get_version
    parsed_version = _do_parse(config)
  File "/build/whipper/src/whipper-0.8.0/.eggs/setuptools_scm-3.3.3-py2.7.egg/setuptools_scm/__init__.py", line 113, in _do_parse
    "use git+https://github.com/user/proj.git#egg=proj" % config.absolute_root
LookupError: setuptools-scm was unable to detect version for '/build/whipper/src/whipper-0.8.0'.

Make sure you're either building from a fully intact git repository or PyPI tarballs. Most other sources (such as GitHub's tarballs, a git checkout without the .git folder) don't contain the necessary metadata and will not work.

But building from a git clone of the 0.8.0 tag ends up with:

$ whipper --version
whipper 0.8.1.dev0+g4238e71.d20191030

I did not look where the version number was computed, but currently this is not working as I would expect.

@ArchangeGabriel
Copy link
Author

Related to #370.

@Freso
Copy link
Member

Freso commented Oct 31, 2019

We don’t have any setup.cfg changing how setuptools_scm calculate release versions, so we should be following the pattern of https://github.com/pypa/setuptools_scm/#default-versioning-scheme

Can you paste the output of git describe --long --tags?

I get this (from the master branch):

> git describe --long --tags
v0.8.0-0-g4238e71
> python2 setup.py --version
0.8.0
> git checkout v0.8.0 
Note: switching to 'v0.8.0'.

[…]

HEAD is now at 4238e71 Merge branch 'develop'
> python2 setup.py --version
0.8.0
> git describe --long --tags
v0.8.0-0-g4238e71

@ArchangeGabriel
Copy link
Author

v0.8.0-0-g4238e71 in both build, check and package.
However python2 setup.py --version is returning 0.8.0 in the first two, but 0.8.1.dev0+g4238e71.d20191031 in the third one because… I’m patching locally for #420 (and thus the tree is not clean anymore at package time).
Checking out the file afterwards works. So how are people expected to eventually patch locally but still get the right version number?

@Freso
Copy link
Member

Freso commented Oct 31, 2019

I mean, if you patch the file locally, then that is the correct version number you’re getting.

@Freso Freso closed this as completed Oct 31, 2019
@Freso Freso added the Expected Behaviour Bug report of intended functionality label Oct 31, 2019
@ArchangeGabriel
Copy link
Author

Not really… It just says the tree wasn’t clean at build time on the given date. Building another time will have a different version number, but that does not makes sense. And any change will have this same version number, but could have very different content. So this version number does not make any sense.

Anyway for this time I’ve built whipper bypassing this since we only modify a test during check.

@Freso
Copy link
Member

Freso commented Oct 31, 2019

You could apply the patch as a git commit, that way you will get a .dev1+g… instead. Other than that, I’d say that it does make sense. Without anything to reference, the dirty tree could contain whatever, so the only thing that can really be said about the version is the day that it was made.

@jpalus
Copy link

jpalus commented Nov 12, 2019

Not that I think anyone cares, but being whipper maintainer in my distribution of choice, it's enough of a reason to stop updating whipper to new versions. Requiring git checkout just to get a proper release version is an overkill.

@adrienbeau
Copy link

According to the message above (Make sure you're either building from a fully intact git repository or PyPI tarballs), you should be able to use the PyPI tarballs rather than git checkout. Does that not work for you?

@jpalus
Copy link

jpalus commented Nov 18, 2019

This is a generic setuptools-scm error message. There are no PyPI tarballs for whipper or at least none I'm aware of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expected Behaviour Bug report of intended functionality
Projects
None yet
Development

No branches or pull requests

4 participants