diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2025-02-04 18:15:06 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2025-02-04 21:07:27 +0300 |
commit | b70e82eebea77757f33e6b77b6f1512cc326bfc6 (patch) | |
tree | 237352cd06b6a51e8b5dd410ad4ed45a0c2ef414 /contrib/python | |
parent | 8741caac7b0e574bd23431ba43e68ec1c9fc2a31 (diff) | |
download | ydb-b70e82eebea77757f33e6b77b6f1512cc326bfc6.tar.gz |
Intermediate changes
commit_hash:7515000bb2a1a163da5e4501067f274b33ca619d
Diffstat (limited to 'contrib/python')
4 files changed, 82 insertions, 30 deletions
diff --git a/contrib/python/importlib-metadata/py3/.dist-info/METADATA b/contrib/python/importlib-metadata/py3/.dist-info/METADATA index d1ad5b7cdd..b5a602cbff 100644 --- a/contrib/python/importlib-metadata/py3/.dist-info/METADATA +++ b/contrib/python/importlib-metadata/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ -Metadata-Version: 2.1 +Metadata-Version: 2.2 Name: importlib_metadata -Version: 8.5.0 +Version: 8.6.1 Summary: Read metadata from Python packages Author-email: "Jason R. Coombs" <jaraco@jaraco.com> Project-URL: Source, https://github.com/python/importlib_metadata @@ -9,36 +9,36 @@ Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only -Requires-Python: >=3.8 +Requires-Python: >=3.9 Description-Content-Type: text/x-rst License-File: LICENSE -Requires-Dist: typing-extensions >=3.6.4 ; python_version < "3.8" +Requires-Dist: typing-extensions>=3.6.4; python_version < "3.8" +Provides-Extra: test +Requires-Dist: pytest!=8.1.*,>=6; extra == "test" +Requires-Dist: importlib_resources>=1.3; python_version < "3.9" and extra == "test" +Requires-Dist: packaging; extra == "test" +Requires-Dist: pyfakefs; extra == "test" +Requires-Dist: flufl.flake8; extra == "test" +Requires-Dist: pytest-perf>=0.9.2; extra == "test" +Requires-Dist: jaraco.test>=5.4; extra == "test" +Provides-Extra: doc +Requires-Dist: sphinx>=3.5; extra == "doc" +Requires-Dist: jaraco.packaging>=9.3; extra == "doc" +Requires-Dist: rst.linker>=1.9; extra == "doc" +Requires-Dist: furo; extra == "doc" +Requires-Dist: sphinx-lint; extra == "doc" +Requires-Dist: jaraco.tidelift>=1.4; extra == "doc" +Provides-Extra: perf +Requires-Dist: ipython; extra == "perf" Provides-Extra: check -Requires-Dist: pytest-checkdocs >=2.4 ; extra == 'check' -Requires-Dist: pytest-ruff >=0.2.1 ; (sys_platform != "cygwin") and extra == 'check' +Requires-Dist: pytest-checkdocs>=2.4; extra == "check" +Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check" Provides-Extra: cover -Requires-Dist: pytest-cov ; extra == 'cover' -Provides-Extra: doc -Requires-Dist: sphinx >=3.5 ; extra == 'doc' -Requires-Dist: jaraco.packaging >=9.3 ; extra == 'doc' -Requires-Dist: rst.linker >=1.9 ; extra == 'doc' -Requires-Dist: furo ; extra == 'doc' -Requires-Dist: sphinx-lint ; extra == 'doc' -Requires-Dist: jaraco.tidelift >=1.4 ; extra == 'doc' +Requires-Dist: pytest-cov; extra == "cover" Provides-Extra: enabler -Requires-Dist: pytest-enabler >=2.2 ; extra == 'enabler' -Provides-Extra: perf -Requires-Dist: ipython ; extra == 'perf' -Provides-Extra: test -Requires-Dist: pytest !=8.1.*,>=6 ; extra == 'test' -Requires-Dist: packaging ; extra == 'test' -Requires-Dist: pyfakefs ; extra == 'test' -Requires-Dist: flufl.flake8 ; extra == 'test' -Requires-Dist: pytest-perf >=0.9.2 ; extra == 'test' -Requires-Dist: jaraco.test >=5.4 ; extra == 'test' -Requires-Dist: importlib-resources >=1.3 ; (python_version < "3.9") and extra == 'test' +Requires-Dist: pytest-enabler>=2.2; extra == "enabler" Provides-Extra: type -Requires-Dist: pytest-mypy ; extra == 'type' +Requires-Dist: pytest-mypy; extra == "type" .. image:: https://img.shields.io/pypi/v/importlib_metadata.svg :target: https://pypi.org/project/importlib_metadata diff --git a/contrib/python/importlib-metadata/py3/importlib_metadata/_adapters.py b/contrib/python/importlib-metadata/py3/importlib_metadata/_adapters.py index 3b516a2d06..f5b30dd92c 100644 --- a/contrib/python/importlib-metadata/py3/importlib_metadata/_adapters.py +++ b/contrib/python/importlib-metadata/py3/importlib_metadata/_adapters.py @@ -1,11 +1,58 @@ import email.message +import email.policy import re import textwrap from ._text import FoldedCase +class RawPolicy(email.policy.EmailPolicy): + def fold(self, name, value): + folded = self.linesep.join( + textwrap.indent(value, prefix=' ' * 8, predicate=lambda line: True) + .lstrip() + .splitlines() + ) + return f'{name}: {folded}{self.linesep}' + + class Message(email.message.Message): + r""" + Specialized Message subclass to handle metadata naturally. + + Reads values that may have newlines in them and converts the + payload to the Description. + + >>> msg_text = textwrap.dedent(''' + ... Name: Foo + ... Version: 3.0 + ... License: blah + ... de-blah + ... <BLANKLINE> + ... First line of description. + ... Second line of description. + ... <BLANKLINE> + ... Fourth line! + ... ''').lstrip().replace('<BLANKLINE>', '') + >>> msg = Message(email.message_from_string(msg_text)) + >>> msg['Description'] + 'First line of description.\nSecond line of description.\n\nFourth line!\n' + + Message should render even if values contain newlines. + + >>> print(msg) + Name: Foo + Version: 3.0 + License: blah + de-blah + Description: First line of description. + Second line of description. + <BLANKLINE> + Fourth line! + <BLANKLINE> + <BLANKLINE> + """ + multiple_use_keys = set( map( FoldedCase, @@ -57,15 +104,20 @@ class Message(email.message.Message): def _repair_headers(self): def redent(value): "Correct for RFC822 indentation" - if not value or '\n' not in value: + indent = ' ' * 8 + if not value or '\n' + indent not in value: return value - return textwrap.dedent(' ' * 8 + value) + return textwrap.dedent(indent + value) headers = [(key, redent(value)) for key, value in vars(self)['_headers']] if self._payload: headers.append(('Description', self.get_payload())) + self.set_payload('') return headers + def as_string(self): + return super().as_string(policy=RawPolicy()) + @property def json(self): """ diff --git a/contrib/python/importlib-metadata/py3/patches/01-add-arcadia-support.patch b/contrib/python/importlib-metadata/py3/patches/01-add-arcadia-support.patch index 33e804574e..4cefb34003 100644 --- a/contrib/python/importlib-metadata/py3/patches/01-add-arcadia-support.patch +++ b/contrib/python/importlib-metadata/py3/patches/01-add-arcadia-support.patch @@ -1,7 +1,7 @@ --- contrib/python/importlib-metadata/py3/.dist-info/METADATA (index) +++ contrib/python/importlib-metadata/py3/.dist-info/METADATA (working tree) @@ -15,1 +15,0 @@ Classifier: License :: OSI Approved :: Apache Software License --Requires-Dist: zipp >=3.20 +-Requires-Dist: zipp>=3.20 --- contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py (index) +++ contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py (working tree) @@ -796,6 +795,59 @@ class PathDistribution(Distribution): diff --git a/contrib/python/importlib-metadata/py3/ya.make b/contrib/python/importlib-metadata/py3/ya.make index c9de3138bd..bd8f1d06d9 100644 --- a/contrib/python/importlib-metadata/py3/ya.make +++ b/contrib/python/importlib-metadata/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(8.5.0) +VERSION(8.6.1) LICENSE(Apache-2.0) |