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

Fix semver #281

Merged
merged 1 commit into from
Mar 19, 2024
Merged

Fix semver #281

merged 1 commit into from
Mar 19, 2024

Conversation

samamorgan
Copy link
Contributor

Semantic versions must be in the form MAJOR.MINOR.PATCH-PRERELEASE. The currently applied semver violates the spec.

This is important for CD to function properly. An invalid semver string will cause the job to fail, as it did here: https://github.com/soynatan/django-easy-audit/actions/runs/8333068101/job/22803668383#step:7:9

@jheld
Copy link
Collaborator

jheld commented Mar 19, 2024

Makes sense. Unfortunately these rules are different than what python allowed, otherwise I would have used a different scheme a long time ago.

@jheld jheld merged commit 44b7e32 into soynatan:master Mar 19, 2024
6 checks passed
@samamorgan samamorgan deleted the patch-1 branch March 19, 2024 17:54
@mschoettle
Copy link
Contributor

So what is the solution to satisfy both semver and Python packaging (there it seems to require major.minor.patch[.something]?

@jheld
Copy link
Collaborator

jheld commented Mar 19, 2024

No i think we should be able to make the change. BTW the 1.3.7.a1 release is on PyPI.

@samamorgan
Copy link
Contributor Author

@jheld @mschoettle Hold up, will normal semver rules not work for publishing PyPI packages? If that's the case, I have some more work to do in cd.yml to make that work properly.

@samamorgan
Copy link
Contributor Author

samamorgan commented Mar 19, 2024

If I'm reading the docs correctly, a dash should work fine. Oddly, the normal form is no separator, which I didn't expect.

https://packaging.python.org/en/latest/specifications/version-specifiers/#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.

So, reading that, I would expect a publish action with x.y.z-a1 to go live to PyPI with x.y.za1. That seems to hold true for the latest release: https://pypi.org/project/django-easy-audit/1.3.7a1/

@jheld
Copy link
Collaborator

jheld commented Mar 20, 2024

Regarding the last point, I manually released to PyPI of course, but yes, even the URL/version listed don't match what I set the version as, how fun (it's trivial in this case, but def makes it not an identity function).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants