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(versioning/poetry): improve poetry prerelease version handling #11733
fix(versioning/poetry): improve poetry prerelease version handling #11733
Conversation
Poetry accepts a union of SemVer and PEP440, normalizing certain prerelease tags like alpha -> a, preview -> rc in its internal representation. Since packages published to PyPI use PEP440 versions, this means that a version requirement "^0.8.0-alpha.1" should be updated to "^0.8.0-alpha.2" under the `replace` rule when a version "0.8.0a2" is published to PyPI. To accomplish this, update the poetry versioning scheme to explicitly parse versions using the same regex and normalization rules as poetry itself, and reemit them in SemVer format before kicking down to the npm versioning scheme. The normalization is applied in reverse before returning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work so far ❤️
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy with the docs. I'll leave code review to the maintainers. 😉
@jvansanten I just saw this PR. What a great first-time contribution! |
Thanks! I just fixed up a few extra nits reported by codecov and type-check. |
Older releases of matplotlib (e.g. 0.98.5.1) use PEP440-style release segments of arbitary length. There is no clean mapping from the post-patch segments to SemVer, but this style seems fairly rare and safe to ignore.
I think we're hitting a merge conflict because the tests now use the Jest table format due to PR: #11931 |
This reverts commit b585c54 (due to overeager use of `yarn version` for a local deployment)
Ugh, okay, will fix up. |
Looks like it needs coverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a small styling issue
🎉 This PR is included in version 28.8.4 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Changes:
Update the poetry versioning scheme to explicitly parse versions using the same regex and normalization rules as poetry itself, and reemit them in SemVer format before kicking down to the npm versioning scheme. The normalization is applied in reverse before returning.
Context:
Poetry accepts a union of SemVer and PEP440, normalizing certain prerelease tags like alpha -> a, preview -> rc in its internal representation. Since packages published to PyPI use PEP440 versions, this means that a version requirement "^0.8.0-alpha.1" should be updated to "^0.8.0-alpha.2" under the
replace
rule when a version "0.8.0a2" is published to PyPI. In the previous implementation, PEP440-named releases were simply filtered out.See also:
Documentation (please check one with an [x])
How I've tested my work (please tick one)
I have verified these changes via: