Skip to content

Commit 91148a2

Browse files
committed
Intermediate changes
commit_hash:1a43bcb7f55bea5bd087ad537be5880e0301a09b
1 parent 6e540f8 commit 91148a2

31 files changed

+218
-352
lines changed

contrib/python/importlib-metadata/py3/.dist-info/METADATA

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
Metadata-Version: 2.4
22
Name: importlib_metadata
3-
Version: 8.7.0
3+
Version: 8.7.1
44
Summary: Read metadata from Python packages
55
Author-email: "Jason R. Coombs" <[email protected]>
6+
License-Expression: Apache-2.0
67
Project-URL: Source, https://github.com/python/importlib_metadata
78
Classifier: Development Status :: 5 - Production/Stable
89
Classifier: Intended Audience :: Developers
9-
Classifier: License :: OSI Approved :: Apache Software License
1010
Classifier: Programming Language :: Python :: 3
1111
Classifier: Programming Language :: Python :: 3 :: Only
1212
Requires-Python: >=3.9
1313
Description-Content-Type: text/x-rst
1414
License-File: LICENSE
15-
Requires-Dist: typing-extensions>=3.6.4; python_version < "3.8"
1615
Provides-Extra: test
1716
Requires-Dist: pytest!=8.1.*,>=6; extra == "test"
18-
Requires-Dist: importlib_resources>=1.3; python_version < "3.9" and extra == "test"
1917
Requires-Dist: packaging; extra == "test"
2018
Requires-Dist: pyfakefs; extra == "test"
2119
Requires-Dist: flufl.flake8; extra == "test"
@@ -36,9 +34,10 @@ Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check"
3634
Provides-Extra: cover
3735
Requires-Dist: pytest-cov; extra == "cover"
3836
Provides-Extra: enabler
39-
Requires-Dist: pytest-enabler>=2.2; extra == "enabler"
37+
Requires-Dist: pytest-enabler>=3.4; extra == "enabler"
4038
Provides-Extra: type
41-
Requires-Dist: pytest-mypy; extra == "type"
39+
Requires-Dist: pytest-mypy>=1.0.1; extra == "type"
40+
Requires-Dist: mypy<1.19; platform_python_implementation == "PyPy" and extra == "type"
4241
Dynamic: license-file
4342

4443
.. image:: https://img.shields.io/pypi/v/importlib_metadata.svg
@@ -50,7 +49,7 @@ Dynamic: license-file
5049
:target: https://github.com/python/importlib_metadata/actions?query=workflow%3A%22tests%22
5150
:alt: tests
5251

53-
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
52+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
5453
:target: https://github.com/astral-sh/ruff
5554
:alt: Ruff
5655

contrib/python/importlib-metadata/py3/LICENSE

Lines changed: 72 additions & 201 deletions
Large diffs are not rendered by default.

contrib/python/importlib-metadata/py3/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:target: https://github.com/python/importlib_metadata/actions?query=workflow%3A%22tests%22
88
:alt: tests
99

10-
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
10+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
1111
:target: https://github.com/astral-sh/ruff
1212
:alt: Ruff
1313

contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
NullFinder,
3636
install,
3737
)
38-
from ._functools import method_cache, pass_none
38+
from ._functools import method_cache, noop, pass_none, passthrough
3939
from ._itertools import always_iterable, bucket, unique_everseen
4040
from ._meta import PackageMetadata, SimplePath
4141
from ._typing import md_none
@@ -642,7 +642,8 @@ def _read_files_egginfo_installed(self):
642642
return
643643

644644
paths = (
645-
py311.relative_fix((subdir / name).resolve())
645+
py311
646+
.relative_fix((subdir / name).resolve())
646647
.relative_to(self.locate_file('').resolve(), walk_up=True)
647648
.as_posix()
648649
for name in text.splitlines()
@@ -792,6 +793,20 @@ def find_distributions(self, context=Context()) -> Iterable[Distribution]:
792793
"""
793794

794795

796+
@passthrough
797+
def _clear_after_fork(cached):
798+
"""Ensure ``func`` clears cached state after ``fork`` when supported.
799+
800+
``FastPath`` caches zip-backed ``pathlib.Path`` objects that retain a
801+
reference to the parent's open ``ZipFile`` handle. Re-using a cached
802+
instance in a forked child can therefore resurrect invalid file pointers
803+
and trigger ``BadZipFile``/``OSError`` failures (python/importlib_metadata#520).
804+
Registering ``cache_clear`` with ``os.register_at_fork`` keeps each process
805+
on its own cache.
806+
"""
807+
getattr(os, 'register_at_fork', noop)(after_in_child=cached.cache_clear)
808+
809+
795810
class FastPath:
796811
"""
797812
Micro-optimized class for searching a root for children.
@@ -808,7 +823,8 @@ class FastPath:
808823
True
809824
"""
810825

811-
@functools.lru_cache() # type: ignore[misc]
826+
@_clear_after_fork # type: ignore[misc]
827+
@functools.lru_cache()
812828
def __new__(cls, root):
813829
return super().__new__(cls)
814830

contrib/python/importlib-metadata/py3/importlib_metadata/_adapters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
class RawPolicy(email.policy.EmailPolicy):
1010
def fold(self, name, value):
1111
folded = self.linesep.join(
12-
textwrap.indent(value, prefix=' ' * 8, predicate=lambda line: True)
12+
textwrap
13+
.indent(value, prefix=' ' * 8, predicate=lambda line: True)
1314
.lstrip()
1415
.splitlines()
1516
)

contrib/python/importlib-metadata/py3/importlib_metadata/_functools.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import functools
22
import types
3+
from typing import Callable, TypeVar
34

45

56
# from jaraco.functools 3.3
@@ -102,3 +103,33 @@ def wrapper(param, *args, **kwargs):
102103
return func(param, *args, **kwargs)
103104

104105
return wrapper
106+
107+
108+
# From jaraco.functools 4.4
109+
def noop(*args, **kwargs):
110+
"""
111+
A no-operation function that does nothing.
112+
113+
>>> noop(1, 2, three=3)
114+
"""
115+
116+
117+
_T = TypeVar('_T')
118+
119+
120+
# From jaraco.functools 4.4
121+
def passthrough(func: Callable[..., object]) -> Callable[[_T], _T]:
122+
"""
123+
Wrap the function to always return the first parameter.
124+
125+
>>> passthrough(print)('3')
126+
3
127+
'3'
128+
"""
129+
130+
@functools.wraps(func)
131+
def wrapper(first: _T, *args, **kwargs) -> _T:
132+
func(first, *args, **kwargs)
133+
return first
134+
135+
return wrapper # type: ignore[return-value]

contrib/python/importlib-metadata/py3/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PY3_LIBRARY()
44

5-
VERSION(8.7.0)
5+
VERSION(8.7.1)
66

77
LICENSE(Apache-2.0)
88

contrib/python/jaraco.functools/py3/.dist-info/METADATA

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.4
22
Name: jaraco.functools
3-
Version: 4.3.0
3+
Version: 4.4.0
44
Summary: Functools like those found in stdlib
55
Author-email: "Jason R. Coombs" <[email protected]>
66
License-Expression: MIT
@@ -29,9 +29,10 @@ Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check"
2929
Provides-Extra: cover
3030
Requires-Dist: pytest-cov; extra == "cover"
3131
Provides-Extra: enabler
32-
Requires-Dist: pytest-enabler>=2.2; extra == "enabler"
32+
Requires-Dist: pytest-enabler>=3.4; extra == "enabler"
3333
Provides-Extra: type
34-
Requires-Dist: pytest-mypy; extra == "type"
34+
Requires-Dist: pytest-mypy>=1.0.1; extra == "type"
35+
Requires-Dist: mypy<1.19; platform_python_implementation == "PyPy" and extra == "type"
3536
Dynamic: license-file
3637

3738
.. image:: https://img.shields.io/pypi/v/jaraco.functools.svg

contrib/python/jaraco.functools/py3/jaraco/functools/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,3 +712,11 @@ def wrapper(self, *args, **kwargs):
712712
return self
713713

714714
return wrapper
715+
716+
717+
def noop(*args, **kwargs):
718+
"""
719+
A no-operation function that does nothing.
720+
721+
>>> noop(1, 2, three=3)
722+
"""

contrib/python/jaraco.functools/py3/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PY3_LIBRARY()
44

5-
VERSION(4.3.0)
5+
VERSION(4.4.0)
66

77
LICENSE(MIT)
88

0 commit comments

Comments
 (0)