-
Notifications
You must be signed in to change notification settings - Fork 157
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
Multiple tags result in "unknown" even if correct tag exists #77
Comments
Hm, that's not a use case I'd considered before, but I think we ought to support it. As long as each (setup.py/setup.cfg/versioneer.py) triple are next to each other, it should be possible to support multiple projects in a single repo. The code isn't very good about tolerating multiple tags yet, but I'd like to fix that. The first rule will be to ignore any tags which don't start with the configured The other pressure is that I'd like a good error message in case people misconfigure their I'd originally made it bail as soon as it saw a mis-prefixed tag to make the error case easy to spot, but maybe verbose=True is sufficient. |
I'm having a related issue because I have tags with different prefixes than the The "highest tag" problem looks easy if you use distutils.version.StrictVersion to sort (or possibly LooseVersion). More info. |
OK, I've got a proposed solution in #78. It uses |
Landed, thanks. My brief tests suggest that, when there are multiple tags on a single commit, git-describe returns the highest-sorting one (so zzz-1.0 beats aaa-1.0). When there is no tag on the current commit, a wrong-prefix tag on the previous commit, and a right-prefix tag on the grandparent commit, git-describe with --match correctly ignores the wrong-prefix tag and reports e.g. So I think this might fix the problem, although it might also hide the error situation that I was worried about (a typo in |
Thanks @warner and @DanLipsitt for taking the time to look at this. Have tested with the case described above and confirmed this as fixed in current master. There's another issue I have with tags, but as this is fixed I will raise that separately. Thanks! |
We want to use versioneer to version multiple python packages in a single git repo.
I have 2 setup.cfgs with:
and
In my case I have 2 directories with versioneer installed. And I tag a single commit twice:
I was assuming that doing an sdist upload would result in the ExampleA being versioned as 1.2.3 but it goes up as "unknown".
Turning on verbose I get
Looking at the code it looks like this is from the use of "git describe" which takes the most recent commit. So I suppose this would need to be changed to look at all the tags, not just the most recent one.
Do you envisage supporting this use case? Or am I missing something?
The text was updated successfully, but these errors were encountered: