fix: use most recent tomli

This commit is contained in:
Daylin Morgan 2024-01-03 12:09:52 -06:00
parent 30c756d3e7
commit 082fe2d3f5
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F
2 changed files with 10 additions and 10 deletions

View file

@ -59,7 +59,7 @@ class Package:
def ensure(self):
dir = Path(__file__).parent / self.name
if not dir.is_dir():
subprocess.run(["git", "clone", self.url])
subprocess.run(["git", "clone", self.url, dir])
subprocess.run(["git", "-C", dir, "checkout", self.rev])
@property
@ -173,16 +173,17 @@ SpecifierSet = v_packaging_SpecifierSet
Package(
name="tomli",
url="https://github.com/hukkin/tomli.git",
rev="2.0.1",
# rev="2.0.1",
rev="a6138675bcca68eea5b8abec7c2ec06d57f965a0",
files=(
("_types", [[7, 11]]),
("_re", [[14, 107]]),
("_parser", [[20, 691]]),
),
prefix="""
try:
if sys.version_info >= (3, 11):
from tomllib import loads as toml_loads
except ImportError:
else:
# MODIFIED FROM https://github.com/hukkin/tomli
# see below for original license
# SPDX-License-Identifier: MIT
@ -194,7 +195,6 @@ except ImportError:
from collections.abc import Iterable # noqa
from functools import lru_cache # noqa
from datetime import date, datetime, time, timedelta, timezone, tzinfo # noqa
from io import BinaryIO
from types import MappingProxyType # noqa
from typing import IO, Any, Callable, NamedTuple # noqa
""",

View file

@ -58,9 +58,9 @@ __version__ = "2023.1003-pep723"
#### START VENDORED TOMLI ####
try:
if sys.version_info >= (3, 11):
from tomllib import loads as toml_loads
except ImportError:
else:
# MODIFIED FROM https://github.com/hukkin/tomli
# see below for original license
# SPDX-License-Identifier: MIT
@ -71,7 +71,6 @@ except ImportError:
from collections.abc import Iterable # noqa
from functools import lru_cache # noqa
from datetime import date, datetime, time, timedelta, timezone, tzinfo # noqa
from io import BinaryIO
from types import MappingProxyType # noqa
from typing import IO, Any, Callable, NamedTuple # noqa
@ -190,7 +189,7 @@ except ImportError:
pass
def v_tomli_load(
__fp: BinaryIO, *, parse_float: v_tomli_ParseFloat = float
__fp: IO[bytes], *, parse_float: v_tomli_ParseFloat = float
) -> dict[str, Any]:
b = __fp.read()
try:
@ -1631,7 +1630,8 @@ class v_packaging_SpecifierSet(v_packaging_BaseSpecifier):
specifier._prereleases = self._prereleases
else:
raise ValueError(
"Cannot combine v_packaging_SpecifierSets with True and False prerelease overrides." # noqa
"Cannot combine v_packaging_SpecifierSets "
"with True and False prerelease overrides."
)
return specifier