Repository navigation
Default an omitted fastnumbers patch component to zero - #209
Closed
harbinresearcher wants to merge 1 commit into
Closed
harbinresearcher wants to merge 1 commit into
harbinresearcher wants to merge 1 commit into
Conversation
Owner
|
This seem like a solution looking for a problem. Is this a real problem actually found in real code, or is this a contrived example? |
Author
|
This is a constructed version-string example, not a failure found in real application code. I reproduced it by substituting a short The optional regex group suggested a parser inconsistency, but that does not establish an actual compatibility problem. I'll withdraw this PR and the associated report rather than ask you to maintain a change without a demonstrated need. |
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.
Closes #208.
The fastnumbers compatibility regex already accepts versions without a patch component, but converting the absent group with
int(None)raisesTypeError. Treat that component as zero, so2.0compares as2.0.0and the minimum-version guard retains its usualImportErrorfor an unsupported1.9.This preserves the regex and its existing prerelease comparison behavior. It adds no dependency or public API.
Validation:
(5, 0, 1).natsort.py:695.twine checkpassed. Installing the built wheel into a separate target, verifying the actual imported module, and running the target test file gave 39 passed.ValueError.To exercise the import path, isolated child processes used real fastnumbers 5.2.0 with only its reported version string temporarily changed to
2.0or5.0. They fail duringimport natsorton the original code and sort normally after the fix. These are simulated shortened version strings: no published fastnumbers release reporting them has been identified, and no deployment failure is claimed.AI assistance was used for investigation, implementation, tests, automated review, and this description. PyICU, macOS, FreeBSD, and the full interpreter matrix were not tested locally. This is a parser consistency fix, not a general PEP 440 implementation.