Repository navigation
Support PEP 440 versioning #455
Description
Activity
- addedfeatureA new feature or a feature requestA new feature or a feature request
on Jun 9, 2022 - addedhelp-wantedExtra attention is requiredExtra attention is required
on Jul 2, 2022 @thearchitector would this requirement be met by being able to configure
prerelease_tagon a per-branch basis? It sounds like you want to create different prerelease formats based on (I'm guessing) the branch you're using?I don't think restricting to PEP 440 versions only is a good idea - although PSR is a Python tool, nothing precludes it from running against projects in other languages. For example it would be a small leap to support config in
Cargo.tomlfor Rust projects in the future - but Rust projects won't need to know/care about PEP 440- removedhelp-wantedExtra attention is requiredExtra attention is required
on Aug 24, 2022 I am finding the tool really useful in theory, but I am not able to use it for work projects due to the lack of support of PEP 440...
From what I gather, the formatX.Y.Z-tag.Nis not at all compatible with PEP 440, or at least is not considered canonical. It keeps us from publishing prerelease packages using PSR which is a shame.A supported format would be
X.Y.ZtagNwhere tag could be one of many,rc,devor others, which can be covered with the use ofprerelease_tag.It would be nice to have a
--pep440option or similar to natively support compatibility with PEP 440 prerelease versions.Ah yes - the "." before the revision specifier, sorry for not getting that sooner. I've hit the same pain before, I agree that a
--pep-440would be valuable.An alternative might be to have a
--version-compat=flag which can be set topythonto achieve the same goal - but with the advantage of being able to allow additional values down the line if another language has a similar quirk (admittedly I don't know of one offhand). What do you think?Reacted by Martin BABEAU and David WaterworthI do think a
--version-compat=flag allows for better future-proofing, as others might want to use it if there are weird standards in other languages, or even if python decides to change the versioning schema (offhand, I can only think of the MAVEN convention which differs slightly, like the PEP 440.)- addedhelp-wantedExtra attention is requiredExtra attention is required
on Sep 23, 2022 - removedhelp-wantedExtra attention is requiredExtra attention is required
on Oct 23, 2022 - addedhelp-wantedExtra attention is requiredExtra attention is requiredand removedhelp-wantedExtra attention is requiredExtra attention is required
on Nov 13, 2022 Python Semantic Release pre-releases aren't compatible with Poetry because
project.tomlrequires PEP440.I really hope there would be a way to configure the version format.
Reacted by David Waterworth and Constantin Hüttereri like the
version-compatconcept (though open to other, possibly clearer, names). I can draft a PR and see how things turn out.This issue is stale because it has not been confirmed or planned by the maintainers and has been open 90 days with no recent activity. It will be closed in 7 days, if no further activity occurs. Thank you for your contributions.
9 remaining items
It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?
- addedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Nov 6, 2024 Need to update & complete the PR and this will become reality. Hopefully over the upcoming month.
Reacted by Stefano, David Waterworth, Constantin Hütterer and Matt Gebert- removedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Nov 10, 2024 It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?
- addedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Jan 9, 2025 Still under development, PR is a little stagnant at the moment as I have been working other things.
- removedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Jan 10, 2025 It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?
- addedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Mar 11, 2025 Still in development, but progress has stalled.
Reacted by Matt Gebert- removedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Apr 20, 2025 It has been 60 days since the last update on this confirmed issue. @python-semantic-release/team can you provide an update on the status of this issue?
- addedneeds-updateNeeds status update from maintainersNeeds status update from maintainers
on Jun 19, 2025
Description
It would be useful to support PEP 440 versioning alongside, or instead of, semantic versioning (they are similar, with subtle differences in identifiers).
Use cases
Poetry enforces PEP 440.
pip,pypiandsetuptoolsall will or currently do support it, and may also require it. Since this package is intended for python specifically, it would make sense to support versioning that adheres to the accepted format.Possible implementation
Currently, there is a
--prereleaseoption. In PEP 440, you can also have post releases, dev releases, and local versions. It would be nice / required to have those options as kwarg flags as well (like--postrelease,--dev,--local).In terms of
prerelease, theprerelease_tagwould have to go from accepting any input to accepting only those valid in the spec (alpha,beta,pre,preview,a,b,c, andrc).PEP 440 also provides regular expressions that can be used to check and extract existing version identifiers, which could be useful in automatically determining the next version of a valid release.