fix(versions): name the version part that could not be read - #3881
Open
chiruu12 wants to merge 1 commit into
Open
fix(versions): name the version part that could not be read#3881chiruu12 wants to merge 1 commit into
chiruu12 wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3881 +/- ##
=======================================
Coverage 88.81% 88.81%
=======================================
Files 120 120
Lines 13357 13357
Branches 2271 2271
=======================================
Hits 11863 11863
Misses 931 931
Partials 563 563
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3880
The catch-all
elseinVersion.__init__reported every part it could not read as a postrelease. An epoch, a local version, a dev release and a plain typo all arrived there and all got the same answer, which points the reader at a segment their string does not contain.The message now names the part that failed and lists what the parser accepts:
Nothing about what parses changes. Only the exception text moved.
InvalidPyVersionis still what gets raised, so the two handlers inmodels/candidates.pyare unaffected.Six parametrized cases cover the misreported forms, plus
1.0.post1so the one accurate use of the old wording stays pinned. All six fail on the parent commit.tests/models/: 228 passed, andruff checkandruff format --checkare clean.