You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this happens when specifier is longer that prospective and epoch is involved. The problem originates from the function _pad_version in packaging.specifiers.
def_pad_version(left: List[str], right: List[str]) ->Tuple[List[str], List[str]]:
left_split, right_split= [], []
# Get the release segment of our versionsleft_split.append(list(itertools.takewhile(lambdax: x.isdigit(), left)))
right_split.append(list(itertools.takewhile(lambdax: x.isdigit(), right)))
# Get the rest of our versionsleft_split.append(left[len(left_split[0]) :])
right_split.append(right[len(right_split[0]) :])
# Insert our paddingleft_split.insert(1, ["0"] *max(0, len(right_split[0]) -len(left_split[0])))
right_split.insert(1, ["0"] *max(0, len(left_split[0]) -len(right_split[0])))
return (list(itertools.chain(*left_split)), list(itertools.chain(*right_split)))
This function didn't take into account the situation where epoch exists. see the testing results.
The text was updated successfully, but these errors were encountered:
`_pad_version` assumes that all components that aren't numeric are
suffixes. But that assumption breaks when epoch numbers are present,
because `_version_split` outputs a component like "2!1".
Fix the assumption by making `_version_split` separate the epoch number
into its own component. Introduce `_version_join` to correctly join
the output of `_version_split` back into a string, which is needed by
`_compare_compatible`.
Fixespypa#683
`_pad_version` assumes that all components that aren't numeric are
suffixes. But that assumption breaks when epoch numbers are present,
because `_version_split` outputs a component like "2!1".
Fix the assumption by making `_version_split` separate the epoch number
into its own component. Introduce `_version_join` to correctly join
the output of `_version_split` back into a string, which is needed by
`_compare_compatible`.
Fixespypa#683
SpecLad
added a commit
to SpecLad/packaging
that referenced
this issue
Oct 1, 2023
`_pad_version` assumes that all components that aren't numeric are
suffixes. But that assumption breaks when epoch numbers are present,
because `_version_split` outputs a component like "2!1".
Fix the assumption by making `_version_split` separate the epoch number
into its own component. Introduce `_version_join` to correctly join
the output of `_version_split` back into a string, which is needed by
`_compare_compatible`.
Fixespypa#683
see the results:
this happens when specifier is longer that prospective and epoch is involved. The problem originates from the function
_pad_version
inpackaging.specifiers
.This function didn't take into account the situation where epoch exists. see the testing results.
The text was updated successfully, but these errors were encountered: