diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-07-08 09:35:32 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-07-08 09:47:15 +0300 |
commit | 8559b4b939beae62d76b5f217510f07bf8389a76 (patch) | |
tree | 21d4adb53921f23f4e2d93febc45c400315bddc3 /contrib | |
parent | 3bae79c9150507daf75442f8175e1efd6a69c339 (diff) | |
download | ydb-8559b4b939beae62d76b5f217510f07bf8389a76.tar.gz |
Intermediate changes
Diffstat (limited to 'contrib')
4 files changed, 29 insertions, 7 deletions
diff --git a/contrib/python/importlib-metadata/py3/.dist-info/METADATA b/contrib/python/importlib-metadata/py3/.dist-info/METADATA index 49797cf89b..ed13bc60a6 100644 --- a/contrib/python/importlib-metadata/py3/.dist-info/METADATA +++ b/contrib/python/importlib-metadata/py3/.dist-info/METADATA @@ -1,9 +1,9 @@ Metadata-Version: 2.1 Name: importlib_metadata -Version: 7.2.0 +Version: 7.2.1 Summary: Read metadata from Python packages Author-email: "Jason R. Coombs" <jaraco@jaraco.com> -Project-URL: Homepage, https://github.com/python/importlib_metadata +Project-URL: Source, https://github.com/python/importlib_metadata Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License diff --git a/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py b/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py index 792f0b6732..579b9ce591 100644 --- a/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py +++ b/contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py @@ -18,7 +18,7 @@ import posixpath import collections from . import _meta -from .compat import py39 +from .compat import py39, py311 from ._collections import FreezableDefaultDict, Pair from ._compat import ( NullFinder, @@ -575,9 +575,8 @@ class Distribution(DeprecatedNonAbstract): return paths = ( - (subdir / name) - .resolve() - .relative_to(self.locate_file('').resolve()) + py311.relative_fix((subdir / name).resolve()) + .relative_to(self.locate_file('').resolve(), walk_up=True) .as_posix() for name in text.splitlines() ) diff --git a/contrib/python/importlib-metadata/py3/importlib_metadata/compat/py311.py b/contrib/python/importlib-metadata/py3/importlib_metadata/compat/py311.py new file mode 100644 index 0000000000..3a5327436f --- /dev/null +++ b/contrib/python/importlib-metadata/py3/importlib_metadata/compat/py311.py @@ -0,0 +1,22 @@ +import os +import pathlib +import sys +import types + + +def wrap(path): # pragma: no cover + """ + Workaround for https://github.com/python/cpython/issues/84538 + to add backward compatibility for walk_up=True. + An example affected package is dask-labextension, which uses + jupyter-packaging to install JupyterLab javascript files outside + of site-packages. + """ + + def relative_to(root, *, walk_up=False): + return pathlib.Path(os.path.relpath(path, root)) + + return types.SimpleNamespace(relative_to=relative_to) + + +relative_fix = wrap if sys.version_info < (3, 12) else lambda x: x diff --git a/contrib/python/importlib-metadata/py3/ya.make b/contrib/python/importlib-metadata/py3/ya.make index 72a4b5af53..9f1a42353d 100644 --- a/contrib/python/importlib-metadata/py3/ya.make +++ b/contrib/python/importlib-metadata/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(7.2.0) +VERSION(7.2.1) LICENSE(Apache-2.0) @@ -19,6 +19,7 @@ PY_SRCS( importlib_metadata/_meta.py importlib_metadata/_text.py importlib_metadata/compat/__init__.py + importlib_metadata/compat/py311.py importlib_metadata/compat/py39.py importlib_metadata/diagnose.py ) |