-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
devX
tags get special treatment
#1040
Comments
It's the most safe/sane component of the version as by the python pep for package versions to put under control Any deliberate release ought to come from a tag |
I'm sorry, I'm afraid that I do not understand that reasoning. :-) By python pep, you mean https://peps.python.org/pep-0440/? That PEP only seem to document certain usage patterns of Speaking for myself, the whole point of choosing setuptools_scm was the ability to make more ad-hoc versions with less deliberation between releases. Perhaps I misunderstood... |
Setuptools-scm is more about using the scm as the source of truth The default version shemes use .dev to create pseudo unique versions per commit Most quick/ad hoc releases would then simply get a non dev version tgged |
Wouldn't git commit hash be enough to create pseudo unique versions? The previous behavior was creating packages with names like I sincerely appreciate the work done on setuptools_scm, but I also want to register a little protest here: it does not seem right for build tools to get in the way, or break existing builds, or spring surprises like this. If it must be done, it should be documented. Perhaps I should have pinned setuptools_scm, or perhaps I should not rely on it anymore. :-/ |
Please help me understand something, maybe I don't get how this tool does its thing. I have develop and master branches. Master is used only for "big" releases, f.e. to PyPI. The last commit pushed to master has a manually added tag, so I can control when semver changes happen. This one is clear. But I also want to have github prereleases for every PR merged to develop. Last time I setup this tool it was correctly bumping the .devX tags with the expected distance from the last non-dev tag. But recently it shows the same error as above. So how should I configure that tool so it allows me to achieve that I want? |
or to put it differently: when the tool sees the latest tag is x.y.z.devX, why it doesn't drop the .devX part and re-calculate the distance from x.y.z again, to make a new devY? |
The tool refuses to hide incorrect usage and incorrect data If a specific dev version is tagged,then guessing is no longer safe A non numbered dev tag can be used to denote the start of a new line A explicit dev tag means we no longer know the intent and refuse to guess |
So it means that there can be only one .devX tag after a "full" tag, yes? F.e. if I already have 1.2.3.dev12, I then need to manually add 1.2.3 in develop, so it's then versioned with .dev0? I'm confused with the logic behind it or the what is the use case. Under what circumstances after I have a release 1.2.3 I could then get multiple 1.2.4.devX pre-releases? |
Every commit after the tag gets a own version, x being the distance from the Tag |
That's what I thought. But when it tries to tag the next commit after an already present prior .devX, it throws the error. |
The dev version ought not to be tagged |
The dev version is implied by the latest tag and the distance A dev tag to denote the start of a new base version explicitly ought not to have a distance |
ok then, we're getting somewhere. So if I want to have prereleases in GH, I should simply tag them with anything that does not match the tool pattern, so it does not bump version from something it should not. Correct? |
What kinda pre release do you want Pep440 has a lot of painful Nuance |
I want each commit to develop to be a GH prerelease (I need built binaries from CI). I don't care about how its tag is defined, as long as it doesn't break the flow of this tool. |
Using PEP440 nomenclature I basically need developmental releases, which I will then publish on GH as a pre-release. The naming might have been confusing on my side. |
The .dev we add are development releases, as far as I understand the default already does what you want |
it doesn't. Any tag that contains numbers between the last "full" tag and the current one is being parsed with regex as potential candidate. When it doesn't match the process fails. f.e.:
when I run the tool I get the expected new version: When I add any alpha-only tag in between HEAD and the current tag, it will always show the properly generated .dev17 tag. But as soon as a tag contains any digits, it's being parsed with regex and the process fails, like so:
and after some traceback it ends up with assertion error It would seem that this tool now effectively prevents from having other tags in the history. Shouldn't it skip the unmatched tag and try on the next one if present, and then still return the .dev17? |
Is there any reason for not using a valid pre release dev version as tag In your example |
A key reason why it's not skipping tags easily is that it requires very specific errors prone git describe invocation plus no availability in Export archives, so expecting users to stay within pep440 enures more robust and wider usage options |
Fine, I can alter my tagging to make it compatible. I've tested this manual tag and it works. Now I need to find out how to automate that and/or which configuration settings to change. The docs are quite confusing for me... |
Anyway, I have a feeling that something so simple that I want to achieve is unnecessarily complicated. |
It's either that or having to explain to people why their metadata is Sometimes broken and sometimes not |
I need to rethink all that. Thanks a lot for the explanation. |
I'm not sure if this is a bug or feature, but it does not seem to be documented.
I have been using
devX
tags in a couple of projects that happen to use setuptools_scm, and it's been working just fine so far. Lately they've just started emitting these errors whenpip install
-ing them:That caused some head-scratching. Why
devX
tags get this treatment, and why not, say,rcX
tags? I'm sure there are good reasons, but it would be nice to have this behavior documented.The text was updated successfully, but these errors were encountered: