Skip to content
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

Add Python versioning scheme #54

Closed
5 tasks
Tracked by #14
tombruijn opened this issue May 2, 2023 · 2 comments · Fixed by #57
Closed
5 tasks
Tracked by #14

Add Python versioning scheme #54

tombruijn opened this issue May 2, 2023 · 2 comments · Fixed by #57
Assignees

Comments

@tombruijn
Copy link
Member

To do

  • Add version_scheme config option, with possible value: python
  • When this version scheme is selected, the prerelease naming is as follows:
    • release candidate: 1.0.0rc1
    • beta: 1.0.0b1
    • alpha: 1.0.0a1
@unflxw
Copy link
Contributor

unflxw commented May 3, 2023

Turns out we don't have to do this work. PEP 440, which defines version identifiers, defines normalisation rules to transform "alternative" version string formats into the one defined by the PEP. Specifically:

Pre-release separators
Pre-releases should allow a ., -, or _ separator between the release segment and the pre-release segment. The normal form for this is without a separator. This allows versions such as 1.1.a1 or 1.1-a1 which would be normalized to 1.1a1.
Pre-release spelling
Pre-releases allow the additional spellings of alpha, beta, c, pre, and preview for a, b, rc, rc, and rc respectively. This allows versions such as 1.1alpha1, 1.1beta2, or 1.1c3

And hatch version, it turns out, follows these rules flawlessly:

> hatch version 1.0.0-alpha1
Old: 0.0.1
New: 1.0.0a1

imagen

@unflxw unflxw closed this as completed May 3, 2023
@tombruijn
Copy link
Member Author

Unfortunately mono doesn't parse the shorthand python naming scheme very well for prereleases. So we should at least support that.

mono publish --alpha
The following packages will be published (or not):
- python:
  Current version: v0.0.1-a.1
  Next version:    v0.0.1-alpha.1 (patch)
  Changesets:
  - Changed - patch: ./.changesets/test2.md
      test2

Description of the output above: it tries to release another alpha.1 release, because it doesn't understand the version it parsed "0.0.1a1` as an alpha release.

@tombruijn tombruijn reopened this May 4, 2023
@unflxw unflxw self-assigned this May 4, 2023
@unflxw unflxw closed this as completed in #57 May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants