mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-12-22 02:30:44 -06:00
chore: bump packaging to v24
This commit is contained in:
parent
4c236e96eb
commit
c43f2f027c
2 changed files with 18 additions and 11 deletions
|
@ -131,12 +131,13 @@ PACKAGES = [
|
||||||
Package(
|
Package(
|
||||||
name="packaging",
|
name="packaging",
|
||||||
url="https://github.com/pypa/packaging.git",
|
url="https://github.com/pypa/packaging.git",
|
||||||
rev="23.2",
|
# v24.0
|
||||||
|
rev="7a983f7f0068669ead9d4f7571be24d6c0d83eb9",
|
||||||
files=(
|
files=(
|
||||||
("_structures", [[5, 61]]),
|
("_structures", [[5, 61]]),
|
||||||
("version", [[17, 563]]),
|
("version", [[17, 563]]),
|
||||||
("utils", [[54, 100]]),
|
("utils", [[54, 100]]),
|
||||||
("specifiers", [[28, 1030]]),
|
("specifiers", [[18, 1017]]),
|
||||||
),
|
),
|
||||||
basepath=Path(__file__).parent / "packaging/src/packaging",
|
basepath=Path(__file__).parent / "packaging/src/packaging",
|
||||||
prefix="""
|
prefix="""
|
||||||
|
|
|
@ -1363,7 +1363,7 @@ class v_packaging_Specifier(v_packaging_BaseSpecifier):
|
||||||
)
|
)
|
||||||
self._prereleases = prereleases
|
self._prereleases = prereleases
|
||||||
|
|
||||||
@property # type: ignore
|
@property
|
||||||
def prereleases(self) -> bool:
|
def prereleases(self) -> bool:
|
||||||
if self._prereleases is not None:
|
if self._prereleases is not None:
|
||||||
return self._prereleases
|
return self._prereleases
|
||||||
|
@ -1425,7 +1425,7 @@ class v_packaging_Specifier(v_packaging_BaseSpecifier):
|
||||||
return operator_callable
|
return operator_callable
|
||||||
|
|
||||||
def _compare_compatible(self, prospective: v_packaging_Version, spec: str) -> bool:
|
def _compare_compatible(self, prospective: v_packaging_Version, spec: str) -> bool:
|
||||||
prefix = ".".join(
|
prefix = v_packaging__version_join(
|
||||||
list(
|
list(
|
||||||
itertools.takewhile(
|
itertools.takewhile(
|
||||||
v_packaging__is_not_suffix, v_packaging__version_split(spec)
|
v_packaging__is_not_suffix, v_packaging__version_split(spec)
|
||||||
|
@ -1549,7 +1549,9 @@ v_packaging__prefix_regex = re.compile("^([0-9]+)((?:a|b|c|rc)[0-9]+)$")
|
||||||
|
|
||||||
def v_packaging__version_split(version: str) -> List[str]:
|
def v_packaging__version_split(version: str) -> List[str]:
|
||||||
result: List[str] = []
|
result: List[str] = []
|
||||||
for item in version.split("."):
|
epoch, _, rest = version.rpartition("!")
|
||||||
|
result.append(epoch or "0")
|
||||||
|
for item in rest.split("."):
|
||||||
match = v_packaging__prefix_regex.search(item)
|
match = v_packaging__prefix_regex.search(item)
|
||||||
if match:
|
if match:
|
||||||
result.extend(match.groups())
|
result.extend(match.groups())
|
||||||
|
@ -1558,6 +1560,11 @@ def v_packaging__version_split(version: str) -> List[str]:
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
|
def v_packaging__version_join(components: List[str]) -> str:
|
||||||
|
epoch, *rest = components
|
||||||
|
return f"{epoch}!{'.'.join(rest)}"
|
||||||
|
|
||||||
|
|
||||||
def v_packaging__is_not_suffix(segment: str) -> bool:
|
def v_packaging__is_not_suffix(segment: str) -> bool:
|
||||||
return not any(
|
return not any(
|
||||||
segment.startswith(prefix) for prefix in ("dev", "a", "b", "rc", "post")
|
segment.startswith(prefix) for prefix in ("dev", "a", "b", "rc", "post")
|
||||||
|
@ -1574,7 +1581,9 @@ def v_packaging__pad_version(
|
||||||
right_split.append(right[len(right_split[0]) :])
|
right_split.append(right[len(right_split[0]) :])
|
||||||
left_split.insert(1, ["0"] * max(0, len(right_split[0]) - len(left_split[0])))
|
left_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])))
|
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))
|
return list(itertools.chain.from_iterable(left_split)), list(
|
||||||
|
itertools.chain.from_iterable(right_split)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class v_packaging_SpecifierSet(v_packaging_BaseSpecifier):
|
class v_packaging_SpecifierSet(v_packaging_BaseSpecifier):
|
||||||
|
@ -1582,10 +1591,7 @@ class v_packaging_SpecifierSet(v_packaging_BaseSpecifier):
|
||||||
self, specifiers: str = "", prereleases: Optional[bool] = None
|
self, specifiers: str = "", prereleases: Optional[bool] = None
|
||||||
) -> None:
|
) -> None:
|
||||||
split_specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
|
split_specifiers = [s.strip() for s in specifiers.split(",") if s.strip()]
|
||||||
v_packaging_parsed: Set[v_packaging_Specifier] = set()
|
self._specs = frozenset(map(v_packaging_Specifier, split_specifiers))
|
||||||
for specifier in split_specifiers:
|
|
||||||
v_packaging_parsed.add(v_packaging_Specifier(specifier))
|
|
||||||
self._specs = frozenset(v_packaging_parsed)
|
|
||||||
self._prereleases = prereleases
|
self._prereleases = prereleases
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1631,7 +1637,7 @@ class v_packaging_SpecifierSet(v_packaging_BaseSpecifier):
|
||||||
specifier._prereleases = self._prereleases
|
specifier._prereleases = self._prereleases
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"Cannot combine v_packaging_SpecifierSets "
|
"Cannot combine v_packaging_SpecifierSets"
|
||||||
"with True and False prerelease overrides."
|
"with True and False prerelease overrides."
|
||||||
)
|
)
|
||||||
return specifier
|
return specifier
|
||||||
|
|
Loading…
Reference in a new issue