question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Versioneer keeps returning 0+untagged

See original GitHub issue

Just installed a fresh copy of non-vendored versioneer 0.24 in my git repo. The python3 setup.py version gives:

running version
keywords are unexpanded, not using
got version from VCS {'version': '0+untagged.36.gef18964', 'full-revisionid': 'ef1896454cff6769d92420c72737065076fc71a0', 'dirty': False, 'error': None, 'date': '2022-08-31T18:59:48+0200'}
Version: 0+untagged.36.gef18964
 full-revisionid: ef1896454cff6769d92420c72737065076fc71a0
 dirty: False
 date: 2022-08-31T18:59:48+0200

However git tag returns multiple tags in develop branch. What might be wrong?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
effigiescommented, Sep 1, 2022

Versioneer is really only set up to work with PEP-440 tags, so your dev-branch marking tag could become something like 2.0.1.dev1. From there, versioneer would create versions like 2.0.1.dev1+1.gd91a1f1.

If you want to keep your current tag style, you’re going to need a different tool (or contribute a patch here…). versioningit does have a lot of flexibility here. See https://versioningit.readthedocs.io/en/stable/configuration.html#the-tool-versioningit-tag2version-subtable

1reaction
effigiescommented, Aug 31, 2022

You’re going to need your tag_prefix = v. Once, you do that (and reinstall _version.py), you should get something like:

$ python setup.py version         
/miniconda3/lib/python3.8/site-packages/setuptools/dist.py:544: UserWarning: The version specified ('2.0.1-develop.1+1.gd91a1f1') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
  warnings.warn(
running version
keywords are unexpanded, not using
got version from VCS {'version': '2.0.1-develop.1+1.gd91a1f1', 'full-revisionid': 'd91a1f1826a398e5989ed008a06e7c003a20fb42', 'dirty': False, 'error': None, 'date': '2022-08-31T14:08:43-0400'}
Version: 2.0.1-develop.1+1.gd91a1f1
 full-revisionid: d91a1f1826a398e5989ed008a06e7c003a20fb42
 dirty: False
 date: 2022-08-31T14:08:43-0400

This isn’t PEP-440 compliant, but there is no way in versioneer to strip off the -develop.1 suffix. Other tools like versioningit or setuptools_scm might have that kind of feature.

Read more comments on GitHub >

github_iconTop Results From Across the Web

get_version() returns 0+untagged, even when there are many ...
The documentation just basically assumes that versioneer will, like magic, pick up the output of git describe. It's just not the case for...
Read more >
versioneer — NiftyNet 0.6.0 documentation - Read the Docs
Debugging Versioneer tries to avoid fatal errors: if something goes wrong, it will tend to return a version of "0+unknown". To investigate the...
Read more >
Version String Management in Python - The Mozilla Blog
Version String Management in Python: Introducing python-versioneer. What's a good way to manage version numbers in a Python project?
Read more >
versioneer - PyPI
The "classic" vendored mode installs a copy of versioneer into your repository. ... Both functions return a dictionary with different flavors of version ......
Read more >
Python Versioneer is not generating a -version.py file
I had that problem with a similar setup.cfg file, but in a tiny project with no nested directories and I ended up needing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found