aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2025-05-05 11:33:24 +0000
committerAlexander Smirnov <alex@ydb.tech>2025-05-05 11:33:24 +0000
commita8596d8b407dadf9e47f664cfd242b9a90f10967 (patch)
treebb3b2093eaa39603e2053c810b780cfba37d52b7
parent48341305e50f672d17620a516bd8a4c4bcc5e1e3 (diff)
parent16a995c42a23115817c27d8eb6c4ce7c93c773ad (diff)
downloadydb-a8596d8b407dadf9e47f664cfd242b9a90f10967.tar.gz
Merge pull request #17983 from ydb-platform/merge-libs-250505-0050
-rw-r--r--contrib/python/packaging/py3/.dist-info/METADATA7
-rw-r--r--contrib/python/packaging/py3/packaging/__init__.py2
-rw-r--r--contrib/python/packaging/py3/packaging/_elffile.py3
-rw-r--r--contrib/python/packaging/py3/packaging/_manylinux.py3
-rw-r--r--contrib/python/packaging/py3/packaging/_parser.py3
-rw-r--r--contrib/python/packaging/py3/packaging/_tokenizer.py9
-rw-r--r--contrib/python/packaging/py3/packaging/licenses/__init__.py2
-rw-r--r--contrib/python/packaging/py3/packaging/markers.py75
-rw-r--r--contrib/python/packaging/py3/packaging/metadata.py3
-rw-r--r--contrib/python/packaging/py3/packaging/specifiers.py3
-rw-r--r--contrib/python/packaging/py3/packaging/tags.py39
-rw-r--r--contrib/python/packaging/py3/ya.make2
-rw-r--r--library/cpp/tld/tlds-alpha-by-domain.txt2
-rw-r--r--ydb/ci/rightlib.txt2
14 files changed, 112 insertions, 43 deletions
diff --git a/contrib/python/packaging/py3/.dist-info/METADATA b/contrib/python/packaging/py3/.dist-info/METADATA
index 1479c8694bf..10b290a6cd1 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 <donald@stufft.io>
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 d79f73c574f..d45c22cfd88 100644
--- a/contrib/python/packaging/py3/packaging/__init__.py
+++ b/contrib/python/packaging/py3/packaging/__init__.py
@@ -6,7 +6,7 @@ __title__ = "packaging"
__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 25f4282cc29..7a5afc33b0a 100644
--- a/contrib/python/packaging/py3/packaging/_elffile.py
+++ b/contrib/python/packaging/py3/packaging/_elffile.py
@@ -69,8 +69,7 @@ class ELFFile:
}[(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 61339a6fcc1..95f55762e86 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<major>[0-9]+)\.(?P<minor>[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 c1238c06eab..0007c0aa64a 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 89d041605c0..d28a9b6cf5d 100644
--- a/contrib/python/packaging/py3/packaging/_tokenizer.py
+++ b/contrib/python/packaging/py3/packaging/_tokenizer.py
@@ -68,7 +68,8 @@ DEFAULT_RULES: dict[str, str | re.Pattern[str]] = {
|platform[._](version|machine|python_implementation)
|python_implementation
|implementation_(name|version)
- |extra
+ |extras?
+ |dependency_groups
)\b
""",
re.VERBOSE,
@@ -119,9 +120,9 @@ class Tokenizer:
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 569156d6ca4..6f7f9e6289d 100644
--- a/contrib/python/packaging/py3/packaging/licenses/__init__.py
+++ b/contrib/python/packaging/py3/packaging/licenses/__init__.py
@@ -37,8 +37,8 @@ from typing import NewType, cast
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 fb7f49cf8cd..e7cea57297a 100644
--- a/contrib/python/packaging/py3/packaging/markers.py
+++ b/contrib/python/packaging/py3/packaging/markers.py
@@ -8,7 +8,7 @@ import operator
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 .specifiers import InvalidSpecifier, Specifier
from .utils import canonicalize_name
__all__ = [
+ "EvaluateContext",
"InvalidMarker",
"Marker",
"UndefinedComparison",
@@ -24,7 +25,9 @@ __all__ = [
"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 @@ _operators: dict[str, Operator] = {
}
-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 @@ class Marker:
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 @@ class Marker:
)
-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 721f411cfc4..3bd8602d36c 100644
--- a/contrib/python/packaging/py3/packaging/metadata.py
+++ b/contrib/python/packaging/py3/packaging/metadata.py
@@ -678,8 +678,7 @@ class _Validator(Generic[T]):
)
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 b30926af8bf..c8448043006 100644
--- a/contrib/python/packaging/py3/packaging/specifiers.py
+++ b/contrib/python/packaging/py3/packaging/specifiers.py
@@ -816,8 +816,7 @@ class SpecifierSet(BaseSpecifier):
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 f5903402abb..8522f59c4f2 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
+ <https://developer.android.com/tools/releases/platforms>`__ to return. Defaults
+ to the current system's version, as returned by ``platform.android_ver``.
+ :param str abi: The `Android ABI <https://developer.android.com/ndk/guides/abis>`__,
+ 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 aca7da38f48..0e79cffb75a 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)
diff --git a/library/cpp/tld/tlds-alpha-by-domain.txt b/library/cpp/tld/tlds-alpha-by-domain.txt
index 0d065f12575..77a44925d23 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
diff --git a/ydb/ci/rightlib.txt b/ydb/ci/rightlib.txt
index 70e4498232d..1c0ca8e8bcb 100644
--- a/ydb/ci/rightlib.txt
+++ b/ydb/ci/rightlib.txt
@@ -1 +1 @@
-4c780f0058b83cbc54813f40a3e7d1816e5c04c7
+74c68d5ada88cc1acc7c521cd2570838fce6607e