Skip to content

Support PEP 440 versioning #455

Description

@thearchitector

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, pypi and setuptools all 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 --prerelease option. 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, the prerelease_tag would have to go from accepting any input to accepting only those valid in the spec (alpha, beta, pre, preview, a, b, c, and rc).

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.

Activity

  1. bernardcooke53 commented on Aug 23, 2022

    @bernardcooke53
    Contributor

    @thearchitector would this requirement be met by being able to configure prerelease_tag on 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.toml for Rust projects in the future - but Rust projects won't need to know/care about PEP 440

  2. Aaryia commented on Aug 31, 2022

    @Aaryia

    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 format X.Y.Z-tag.N is 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.ZtagN where tag could be one of many, rc, dev or others, which can be covered with the use of prerelease_tag.

    It would be nice to have a --pep440 option or similar to natively support compatibility with PEP 440 prerelease versions.

  3. bernardcooke53 commented on Aug 31, 2022

    @bernardcooke53
    Contributor

    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-440 would be valuable.

    An alternative might be to have a --version-compat= flag which can be set to python to 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?

  4. Aaryia commented on Sep 1, 2022

    @Aaryia

    I 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.)

  5. added
    help-wantedExtra attention is required
    and removed
    help-wantedExtra attention is required
    on Nov 13, 2022
  6. stefanondisponibile commented on Jun 18, 2023

    @stefanondisponibile

    What about just making the - and . parts configurable?

    I think here and here, but might need to have a closer look.

    So one can have full control over the whole release name and go from X.Y.Z-tag.N (PEP440 🚫 ) to X.Y.ZtagN (PEP440 ✅ ) here.


    Do you see any drawbacks?

  7. Vichoko commented on Jul 31, 2023

    @Vichoko

    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.

  8. thearchitector commented on Aug 1, 2023

    @thearchitector
    Author

    i like the version-compat concept (though open to other, possibly clearer, names). I can draft a PR and see how things turn out.

  9. github-actions commented on Mar 26, 2024

    @github-actions

    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.

  10. 9 remaining items

  11. github-actions commented on Nov 6, 2024

    @github-actions

    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?

  12. codejedi365 commented on Nov 9, 2024

    @codejedi365
    Contributor

    Need to update & complete the PR and this will become reality. Hopefully over the upcoming month.

  13. github-actions commented on Jan 9, 2025

    @github-actions

    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?

  14. codejedi365 commented on Jan 9, 2025

    @codejedi365
    Contributor

    Still under development, PR is a little stagnant at the moment as I have been working other things.

  15. github-actions commented on Mar 11, 2025

    @github-actions

    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?

  16. codejedi365 commented on Apr 20, 2025

    @codejedi365
    Contributor

    Still in development, but progress has stalled.

  17. github-actions commented on Jun 19, 2025

    @github-actions

    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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedPrevent from becoming stalefeatureA new feature or a feature requestneeds-updateNeeds status update from maintainers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions