-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(pep440): handle v-prefixed versions gracefully #40989
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
base: main
Are you sure you want to change the base?
Conversation
viceice
left a comment
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.
needs test to get full coverage
| it('handles bare version that differs from currentVersion without v-prefix', () => { | ||
| const res = getNewValue({ | ||
| currentValue: '1.0.0.0', | ||
| rangeStrategy: 'auto', | ||
| newVersion: '1.2.3', | ||
| currentVersion: '1.0.0', | ||
| }); | ||
| expect(res).toBe('1.2.3'); |
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.
changing from 4 to 3 parts?
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.
Yes, that's a bit weird.
But I think it would be even more weird add a .0 to the version found in the datasource.
Don't you think?
In that sense, it may make sense to also drop the v prefix.
@viceice any thoughts?
Both cases are human mistakes that Poetry tolerates, from what I can tell. Maybe Renovate should just "fix" it (i.e. drop the v prefix and drop the fourth digit).
Changes
Fixes handling of v-prefixed versions (e.g.,
v0.7.15) in pep440 versioning that were previously causingInvalid pep440 currentValueerrors. The fix treats v-prefixed bare versions as pinned versions, bypassing the range parser which doesn't support them, even though Poetry handles them correctly.Context
Please select one of the following:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Claude Opus 4.6 was used to research the issue, implement the fix, and add tests. Manual review and testing were performed to ensure correctness.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: