From f131a79856132ccd30619365e4fc70150f23f564 Mon Sep 17 00:00:00 2001 From: robot-piglet Date: Sun, 4 May 2025 23:21:57 +0300 Subject: [PATCH 1/3] Intermediate changes commit_hash:d02a0fed51b8e0ca502f3177c5b77894d656cea3 --- .../python/packaging/py3/.dist-info/METADATA | 7 +- .../packaging/py3/packaging/__init__.py | 2 +- .../packaging/py3/packaging/_elffile.py | 3 +- .../packaging/py3/packaging/_manylinux.py | 3 +- .../python/packaging/py3/packaging/_parser.py | 3 +- .../packaging/py3/packaging/_tokenizer.py | 9 ++- .../py3/packaging/licenses/__init__.py | 2 +- .../python/packaging/py3/packaging/markers.py | 75 +++++++++++++------ .../packaging/py3/packaging/metadata.py | 3 +- .../packaging/py3/packaging/specifiers.py | 3 +- .../python/packaging/py3/packaging/tags.py | 39 ++++++++++ contrib/python/packaging/py3/ya.make | 2 +- 12 files changed, 110 insertions(+), 41 deletions(-) diff --git a/contrib/python/packaging/py3/.dist-info/METADATA b/contrib/python/packaging/py3/.dist-info/METADATA index 1479c8694bfb..10b290a6cd17 100644 --- a/contrib/python/packaging/py3/.dist-info/METADATA +++ b/contrib/python/packaging/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ -Metadata-Version: 2.3 +Metadata-Version: 2.4 Name: packaging -Version: 24.2 +Version: 25.0 Summary: Core utilities for Python packages Author-email: Donald Stufft Requires-Python: >=3.8 @@ -21,6 +21,9 @@ Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Typing :: Typed +License-File: LICENSE +License-File: LICENSE.APACHE +License-File: LICENSE.BSD Project-URL: Documentation, https://packaging.pypa.io/ Project-URL: Source, https://github.com/pypa/packaging diff --git a/contrib/python/packaging/py3/packaging/__init__.py b/contrib/python/packaging/py3/packaging/__init__.py index d79f73c574ff..d45c22cfd88e 100644 --- a/contrib/python/packaging/py3/packaging/__init__.py +++ b/contrib/python/packaging/py3/packaging/__init__.py @@ -6,7 +6,7 @@ __summary__ = "Core utilities for Python packages" __uri__ = "https://github.com/pypa/packaging" -__version__ = "24.2" +__version__ = "25.0" __author__ = "Donald Stufft and individual contributors" __email__ = "donald@stufft.io" diff --git a/contrib/python/packaging/py3/packaging/_elffile.py b/contrib/python/packaging/py3/packaging/_elffile.py index 25f4282cc29c..7a5afc33b0a2 100644 --- a/contrib/python/packaging/py3/packaging/_elffile.py +++ b/contrib/python/packaging/py3/packaging/_elffile.py @@ -69,8 +69,7 @@ def __init__(self, f: IO[bytes]) -> None: }[(self.capacity, self.encoding)] except KeyError as e: raise ELFInvalid( - f"unrecognized capacity ({self.capacity}) or " - f"encoding ({self.encoding})" + f"unrecognized capacity ({self.capacity}) or encoding ({self.encoding})" ) from e try: diff --git a/contrib/python/packaging/py3/packaging/_manylinux.py b/contrib/python/packaging/py3/packaging/_manylinux.py index 61339a6fcc1b..95f55762e86f 100644 --- a/contrib/python/packaging/py3/packaging/_manylinux.py +++ b/contrib/python/packaging/py3/packaging/_manylinux.py @@ -161,8 +161,7 @@ def _parse_glibc_version(version_str: str) -> tuple[int, int]: m = re.match(r"(?P[0-9]+)\.(?P[0-9]+)", version_str) if not m: warnings.warn( - f"Expected glibc version with 2 components major.minor," - f" got: {version_str}", + f"Expected glibc version with 2 components major.minor, got: {version_str}", RuntimeWarning, stacklevel=2, ) diff --git a/contrib/python/packaging/py3/packaging/_parser.py b/contrib/python/packaging/py3/packaging/_parser.py index c1238c06eab9..0007c0aa64ae 100644 --- a/contrib/python/packaging/py3/packaging/_parser.py +++ b/contrib/python/packaging/py3/packaging/_parser.py @@ -349,6 +349,5 @@ def _parse_marker_op(tokenizer: Tokenizer) -> Op: return Op(tokenizer.read().text) else: return tokenizer.raise_syntax_error( - "Expected marker operator, one of " - "<=, <, !=, ==, >=, >, ~=, ===, in, not in" + "Expected marker operator, one of <=, <, !=, ==, >=, >, ~=, ===, in, not in" ) diff --git a/contrib/python/packaging/py3/packaging/_tokenizer.py b/contrib/python/packaging/py3/packaging/_tokenizer.py index 89d041605c00..d28a9b6cf5da 100644 --- a/contrib/python/packaging/py3/packaging/_tokenizer.py +++ b/contrib/python/packaging/py3/packaging/_tokenizer.py @@ -68,7 +68,8 @@ def __str__(self) -> str: |platform[._](version|machine|python_implementation) |python_implementation |implementation_(name|version) - |extra + |extras? + |dependency_groups )\b """, re.VERBOSE, @@ -119,9 +120,9 @@ def check(self, name: str, *, peek: bool = False) -> bool: another check. If `peek` is set to `True`, the token is not loaded and would need to be checked again. """ - assert ( - self.next_token is None - ), f"Cannot check for {name!r}, already have {self.next_token!r}" + assert self.next_token is None, ( + f"Cannot check for {name!r}, already have {self.next_token!r}" + ) assert name in self.rules, f"Unknown token name: {name!r}" expression = self.rules[name] diff --git a/contrib/python/packaging/py3/packaging/licenses/__init__.py b/contrib/python/packaging/py3/packaging/licenses/__init__.py index 569156d6ca47..6f7f9e6289da 100644 --- a/contrib/python/packaging/py3/packaging/licenses/__init__.py +++ b/contrib/python/packaging/py3/packaging/licenses/__init__.py @@ -37,8 +37,8 @@ from packaging.licenses._spdx import EXCEPTIONS, LICENSES __all__ = [ - "NormalizedLicenseExpression", "InvalidLicenseExpression", + "NormalizedLicenseExpression", "canonicalize_license_expression", ] diff --git a/contrib/python/packaging/py3/packaging/markers.py b/contrib/python/packaging/py3/packaging/markers.py index fb7f49cf8cd4..e7cea57297a2 100644 --- a/contrib/python/packaging/py3/packaging/markers.py +++ b/contrib/python/packaging/py3/packaging/markers.py @@ -8,7 +8,7 @@ import os import platform import sys -from typing import Any, Callable, TypedDict, cast +from typing import AbstractSet, Any, Callable, Literal, TypedDict, Union, cast from ._parser import MarkerAtom, MarkerList, Op, Value, Variable from ._parser import parse_marker as _parse_marker @@ -17,6 +17,7 @@ from .utils import canonicalize_name __all__ = [ + "EvaluateContext", "InvalidMarker", "Marker", "UndefinedComparison", @@ -24,7 +25,9 @@ "default_environment", ] -Operator = Callable[[str, str], bool] +Operator = Callable[[str, Union[str, AbstractSet[str]]], bool] +EvaluateContext = Literal["metadata", "lock_file", "requirement"] +MARKERS_ALLOWING_SET = {"extras", "dependency_groups"} class InvalidMarker(ValueError): @@ -174,13 +177,14 @@ def _format_marker( } -def _eval_op(lhs: str, op: Op, rhs: str) -> bool: - try: - spec = Specifier("".join([op.serialize(), rhs])) - except InvalidSpecifier: - pass - else: - return spec.contains(lhs, prereleases=True) +def _eval_op(lhs: str, op: Op, rhs: str | AbstractSet[str]) -> bool: + if isinstance(rhs, str): + try: + spec = Specifier("".join([op.serialize(), rhs])) + except InvalidSpecifier: + pass + else: + return spec.contains(lhs, prereleases=True) oper: Operator | None = _operators.get(op.serialize()) if oper is None: @@ -189,19 +193,29 @@ def _eval_op(lhs: str, op: Op, rhs: str) -> bool: return oper(lhs, rhs) -def _normalize(*values: str, key: str) -> tuple[str, ...]: +def _normalize( + lhs: str, rhs: str | AbstractSet[str], key: str +) -> tuple[str, str | AbstractSet[str]]: # PEP 685 – Comparison of extra names for optional distribution dependencies # https://peps.python.org/pep-0685/ # > When comparing extra names, tools MUST normalize the names being # > compared using the semantics outlined in PEP 503 for names if key == "extra": - return tuple(canonicalize_name(v) for v in values) + assert isinstance(rhs, str), "extra value must be a string" + return (canonicalize_name(lhs), canonicalize_name(rhs)) + if key in MARKERS_ALLOWING_SET: + if isinstance(rhs, str): # pragma: no cover + return (canonicalize_name(lhs), canonicalize_name(rhs)) + else: + return (canonicalize_name(lhs), {canonicalize_name(v) for v in rhs}) # other environment markers don't have such standards - return values + return lhs, rhs -def _evaluate_markers(markers: MarkerList, environment: dict[str, str]) -> bool: +def _evaluate_markers( + markers: MarkerList, environment: dict[str, str | AbstractSet[str]] +) -> bool: groups: list[list[bool]] = [[]] for marker in markers: @@ -220,7 +234,7 @@ def _evaluate_markers(markers: MarkerList, environment: dict[str, str]) -> bool: lhs_value = lhs.value environment_key = rhs.value rhs_value = environment[environment_key] - + assert isinstance(lhs_value, str), "lhs must be a string" lhs_value, rhs_value = _normalize(lhs_value, rhs_value, key=environment_key) groups[-1].append(_eval_op(lhs_value, op, rhs_value)) else: @@ -298,22 +312,36 @@ def __eq__(self, other: Any) -> bool: return str(self) == str(other) - def evaluate(self, environment: dict[str, str] | None = None) -> bool: + def evaluate( + self, + environment: dict[str, str] | None = None, + context: EvaluateContext = "metadata", + ) -> bool: """Evaluate a marker. Return the boolean from evaluating the given marker against the environment. environment is an optional argument to override all or - part of the determined environment. + part of the determined environment. The *context* parameter specifies what + context the markers are being evaluated for, which influences what markers + are considered valid. Acceptable values are "metadata" (for core metadata; + default), "lock_file", and "requirement" (i.e. all other situations). The environment is determined from the current Python process. """ - current_environment = cast("dict[str, str]", default_environment()) - current_environment["extra"] = "" + current_environment = cast( + "dict[str, str | AbstractSet[str]]", default_environment() + ) + if context == "lock_file": + current_environment.update( + extras=frozenset(), dependency_groups=frozenset() + ) + elif context == "metadata": + current_environment["extra"] = "" if environment is not None: current_environment.update(environment) # The API used to allow setting extra to None. We need to handle this # case for backwards compatibility. - if current_environment["extra"] is None: + if "extra" in current_environment and current_environment["extra"] is None: current_environment["extra"] = "" return _evaluate_markers( @@ -321,11 +349,14 @@ def evaluate(self, environment: dict[str, str] | None = None) -> bool: ) -def _repair_python_full_version(env: dict[str, str]) -> dict[str, str]: +def _repair_python_full_version( + env: dict[str, str | AbstractSet[str]], +) -> dict[str, str | AbstractSet[str]]: """ Work around platform.python_version() returning something that is not PEP 440 compliant for non-tagged Python builds. """ - if env["python_full_version"].endswith("+"): - env["python_full_version"] += "local" + python_full_version = cast(str, env["python_full_version"]) + if python_full_version.endswith("+"): + env["python_full_version"] = f"{python_full_version}local" return env diff --git a/contrib/python/packaging/py3/packaging/metadata.py b/contrib/python/packaging/py3/packaging/metadata.py index 721f411cfc44..3bd8602d36c5 100644 --- a/contrib/python/packaging/py3/packaging/metadata.py +++ b/contrib/python/packaging/py3/packaging/metadata.py @@ -678,8 +678,7 @@ def _process_license_files(self, value: list[str]) -> list[str]: ) if pathlib.PureWindowsPath(path).as_posix() != path: raise self._invalid_metadata( - f"{path!r} is invalid for {{field}}, " - "paths must use '/' delimiter" + f"{path!r} is invalid for {{field}}, paths must use '/' delimiter" ) paths.append(path) return paths diff --git a/contrib/python/packaging/py3/packaging/specifiers.py b/contrib/python/packaging/py3/packaging/specifiers.py index b30926af8bf4..c8448043006f 100644 --- a/contrib/python/packaging/py3/packaging/specifiers.py +++ b/contrib/python/packaging/py3/packaging/specifiers.py @@ -816,8 +816,7 @@ def __and__(self, other: SpecifierSet | str) -> SpecifierSet: specifier._prereleases = self._prereleases else: raise ValueError( - "Cannot combine SpecifierSets with True and False prerelease " - "overrides." + "Cannot combine SpecifierSets with True and False prerelease overrides." ) return specifier diff --git a/contrib/python/packaging/py3/packaging/tags.py b/contrib/python/packaging/py3/packaging/tags.py index f5903402abb5..8522f59c4f2d 100644 --- a/contrib/python/packaging/py3/packaging/tags.py +++ b/contrib/python/packaging/py3/packaging/tags.py @@ -530,6 +530,43 @@ def ios_platforms( ) +def android_platforms( + api_level: int | None = None, abi: str | None = None +) -> Iterator[str]: + """ + Yields the :attr:`~Tag.platform` tags for Android. If this function is invoked on + non-Android platforms, the ``api_level`` and ``abi`` arguments are required. + + :param int api_level: The maximum `API level + `__ to return. Defaults + to the current system's version, as returned by ``platform.android_ver``. + :param str abi: The `Android ABI `__, + e.g. ``arm64_v8a``. Defaults to the current system's ABI , as returned by + ``sysconfig.get_platform``. Hyphens and periods will be replaced with + underscores. + """ + if platform.system() != "Android" and (api_level is None or abi is None): + raise TypeError( + "on non-Android platforms, the api_level and abi arguments are required" + ) + + if api_level is None: + # Python 3.13 was the first version to return platform.system() == "Android", + # and also the first version to define platform.android_ver(). + api_level = platform.android_ver().api_level # type: ignore[attr-defined] + + if abi is None: + abi = sysconfig.get_platform().split("-")[-1] + abi = _normalize_string(abi) + + # 16 is the minimum API level known to have enough features to support CPython + # without major patching. Yield every API level from the maximum down to the + # minimum, inclusive. + min_api_level = 16 + for ver in range(api_level, min_api_level - 1, -1): + yield f"android_{ver}_{abi}" + + def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]: linux = _normalize_string(sysconfig.get_platform()) if not linux.startswith("linux_"): @@ -561,6 +598,8 @@ def platform_tags() -> Iterator[str]: return mac_platforms() elif platform.system() == "iOS": return ios_platforms() + elif platform.system() == "Android": + return android_platforms() elif platform.system() == "Linux": return _linux_platforms() else: diff --git a/contrib/python/packaging/py3/ya.make b/contrib/python/packaging/py3/ya.make index aca7da38f483..0e79cffb75aa 100644 --- a/contrib/python/packaging/py3/ya.make +++ b/contrib/python/packaging/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(24.2) +VERSION(25.0) LICENSE(BSD-2-Clause AND Apache-2.0) From 74c68d5ada88cc1acc7c521cd2570838fce6607e Mon Sep 17 00:00:00 2001 From: robot-ratatosk Date: Mon, 5 May 2025 01:49:40 +0300 Subject: [PATCH 2/3] New version of the tld SKIP_CHECK SKIP_REVIEW commit_hash:246e49c5fbd71919598ec11a86907fa9bb0b9e90 --- library/cpp/tld/tlds-alpha-by-domain.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt index 0d065f125753..77a44925d233 100644 --- a/library/cpp/tld/tlds-alpha-by-domain.txt +++ b/library/cpp/tld/tlds-alpha-by-domain.txt @@ -1,4 +1,4 @@ -# Version 2025050100, Last Updated Thu May 1 07:07:02 2025 UTC +# Version 2025050301, Last Updated Sun May 4 07:07:02 2025 UTC AAA AARP ABB From 16a995c42a23115817c27d8eb6c4ce7c93c773ad Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Mon, 5 May 2025 00:52:02 +0000 Subject: [PATCH 3/3] Import libraries 250505-0050 --- ydb/ci/rightlib.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ydb/ci/rightlib.txt b/ydb/ci/rightlib.txt index 70e4498232da..1c0ca8e8bcb2 100644 --- a/ydb/ci/rightlib.txt +++ b/ydb/ci/rightlib.txt @@ -1 +1 @@ -4c780f0058b83cbc54813f40a3e7d1816e5c04c7 +74c68d5ada88cc1acc7c521cd2570838fce6607e