-
-
Notifications
You must be signed in to change notification settings - Fork 213
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. |
Hello @RonnyPfannschmidt It seems that the question has not been fully addressed yet. Let me explain my development process, which I believe is quite similar to @jziolkowski 's, or @sajith 's, as well as to others who have raised similar questions on forums. I am developing a package, and during the development phase (leading up to the 1.0.0 release), I publish several versions of the package for use in other projects: 1.0.0.dev0, 1.0.0.dev1, 1.0.0.dev2, ..., up to 1.0.0.dev19. This practice follows the guidelines of PEP 440 (although PEP 440 recommends using x.y.devN rather than x.y.z.devN, which is not directly relevant here). However, when working with a local workspace and a "dirty" Git state (where the index/staging area is not clean), I encounter an issue when trying to locally build the package for testing. Running:
results in the following error:
To work around this, my only option so far has been to create a temporary fake tag, which forces me to commit changes I do not wish to commit now. Are there any fallback solutions or Hatch command-line options that I might not be aware of? If so, I would greatly appreciate any guidance. Thank you for your tool and your support! |
The contract for setuptools scm is that it manages the dev versions Currently it's intentionally unsupported to manage them as a developer |
Thanks @RonnyPfannschmidt for clarifying the limitations of setuptools_scm. If so, when publishing a dev release, should I rely on setuptools_scm to automatically generate versions like x.y.dev0+something_obscure? This feels counterintuitive for managing multiple dev iterations. Any suggestions on how to align my workflow with the intended usage? |
the general suggested workflow would be to just have a automated release from the primary branch one detail feature for that is missing however - not rendering the node if on the protected main branch a workaround is configuring the |
my recommendation would be to make alphas/betas as releases to hit pypi and tagging them - my persional oppinion is that alpha/beta is more matching for releases that hit a index while .dev is purely development (key reason why i didn't add the handling of the main branch for releasable artifacts is that i dont need it after all) |
Hi again. Please be sure I insist only to try to ease the life of possible other users. Today I decided to change to another version "tagger" for hatch, because just the fact I have a x.y.z.dev18 tag in my git, it makes fails other jobs like unit tests. Illustration: It means that if my last tag, a few commits before, was 0.1.0.dev19, it makes fails all my future CI jobs. This seems like a major challenge in certain workflows, in my opinion that could impact other users as well |
As per the error that kinda workflow is intentionally not supported |
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: