diff options
| author | robot-piglet <[email protected]> | 2025-05-18 00:01:07 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-05-18 00:10:41 +0300 |
| commit | 6d36267dc1cbbe3b9b6392c031e0899b9344ecd4 (patch) | |
| tree | 28287e7b8e912e86c4c6c67f6615928f9494a9f4 /contrib/python/pip | |
| parent | 4abadc41490687a0cef85be4382a8c6fb0633f06 (diff) | |
Intermediate changes
commit_hash:cfd5a8bdf3911e5b89010825428d90d8527efd21
Diffstat (limited to 'contrib/python/pip')
| -rw-r--r-- | contrib/python/pip/.dist-info/METADATA | 2 | ||||
| -rw-r--r-- | contrib/python/pip/pip/__init__.py | 2 | ||||
| -rw-r--r-- | contrib/python/pip/pip/_internal/commands/install.py | 2 | ||||
| -rw-r--r-- | contrib/python/pip/pip/_internal/operations/install/wheel.py | 7 | ||||
| -rw-r--r-- | contrib/python/pip/pip/_internal/req/req_dependency_group.py | 11 | ||||
| -rw-r--r-- | contrib/python/pip/pip/_internal/utils/misc.py | 18 | ||||
| -rw-r--r-- | contrib/python/pip/pip/_vendor/dependency_groups/_implementation.py | 18 | ||||
| -rw-r--r-- | contrib/python/pip/pip/_vendor/vendor.txt | 2 | ||||
| -rw-r--r-- | contrib/python/pip/ya.make | 2 |
9 files changed, 42 insertions, 22 deletions
diff --git a/contrib/python/pip/.dist-info/METADATA b/contrib/python/pip/.dist-info/METADATA index 0b953fccda6..3cae064c16e 100644 --- a/contrib/python/pip/.dist-info/METADATA +++ b/contrib/python/pip/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: pip -Version: 25.1 +Version: 25.1.1 Summary: The PyPA recommended tool for installing Python packages. Author-email: The pip developers <[email protected]> License: MIT diff --git a/contrib/python/pip/pip/__init__.py b/contrib/python/pip/pip/__init__.py index 52aefb210ac..d4b19f02dea 100644 --- a/contrib/python/pip/pip/__init__.py +++ b/contrib/python/pip/pip/__init__.py @@ -1,6 +1,6 @@ from typing import List, Optional -__version__ = "25.1" +__version__ = "25.1.1" def main(args: Optional[List[str]] = None) -> int: diff --git a/contrib/python/pip/pip/_internal/commands/install.py b/contrib/python/pip/pip/_internal/commands/install.py index 49b8fd78bef..300ae92b337 100644 --- a/contrib/python/pip/pip/_internal/commands/install.py +++ b/contrib/python/pip/pip/_internal/commands/install.py @@ -420,7 +420,7 @@ class InstallCommand(RequirementCommand): reqs_to_build = [ r - for r in requirement_set.requirements.values() + for r in requirement_set.requirements_to_install if should_build_for_install_command(r) ] diff --git a/contrib/python/pip/pip/_internal/operations/install/wheel.py b/contrib/python/pip/pip/_internal/operations/install/wheel.py index 73e4bfc7c00..cfc3b26ebbc 100644 --- a/contrib/python/pip/pip/_internal/operations/install/wheel.py +++ b/contrib/python/pip/pip/_internal/operations/install/wheel.py @@ -13,7 +13,6 @@ import sys import warnings from base64 import urlsafe_b64encode from email.message import Message -from io import StringIO from itertools import chain, filterfalse, starmap from typing import ( IO, @@ -50,7 +49,7 @@ from pip._internal.metadata import ( from pip._internal.models.direct_url import DIRECT_URL_METADATA_NAME, DirectUrl from pip._internal.models.scheme import SCHEME_KEYS, Scheme from pip._internal.utils.filesystem import adjacent_tmp_file, replace -from pip._internal.utils.misc import ensure_dir, hash_file, partition +from pip._internal.utils.misc import StreamWrapper, ensure_dir, hash_file, partition from pip._internal.utils.unpacking import ( current_umask, is_within_directory, @@ -607,7 +606,9 @@ def _install_wheel( # noqa: C901, PLR0915 function is too long # Compile all of the pyc files for the installed files if pycompile: - with contextlib.redirect_stdout(StringIO()) as stdout: + with contextlib.redirect_stdout( + StreamWrapper.from_stream(sys.stdout) + ) as stdout: with warnings.catch_warnings(): warnings.filterwarnings("ignore") for path in pyc_source_file_paths(): diff --git a/contrib/python/pip/pip/_internal/req/req_dependency_group.py b/contrib/python/pip/pip/_internal/req/req_dependency_group.py index 8f124de5b81..e81dd45522a 100644 --- a/contrib/python/pip/pip/_internal/req/req_dependency_group.py +++ b/contrib/python/pip/pip/_internal/req/req_dependency_group.py @@ -1,6 +1,11 @@ +import sys from typing import Any, Dict, Iterable, Iterator, List, Tuple -from pip._vendor import tomli +if sys.version_info >= (3, 11): + import tomllib +else: + from pip._vendor import tomli as tomllib + from pip._vendor.dependency_groups import DependencyGroupResolver from pip._internal.exceptions import InstallationError @@ -65,10 +70,10 @@ def _load_pyproject(path: str) -> Dict[str, Any]: """ try: with open(path, "rb") as fp: - return tomli.load(fp) + return tomllib.load(fp) except FileNotFoundError: raise InstallationError(f"{path} not found. Cannot resolve '--group' option.") - except tomli.TOMLDecodeError as e: + except tomllib.TOMLDecodeError as e: raise InstallationError(f"Error parsing {path}: {e}") from e except OSError as e: raise InstallationError(f"Error reading {path}: {e}") from e diff --git a/contrib/python/pip/pip/_internal/utils/misc.py b/contrib/python/pip/pip/_internal/utils/misc.py index 156accda1bd..44f6a05fbdd 100644 --- a/contrib/python/pip/pip/_internal/utils/misc.py +++ b/contrib/python/pip/pip/_internal/utils/misc.py @@ -11,6 +11,7 @@ import sysconfig import urllib.parse from dataclasses import dataclass from functools import partial +from io import StringIO from itertools import filterfalse, tee, zip_longest from pathlib import Path from types import FunctionType, TracebackType @@ -25,6 +26,7 @@ from typing import ( Mapping, Optional, Sequence, + TextIO, Tuple, Type, TypeVar, @@ -373,6 +375,22 @@ def write_output(msg: Any, *args: Any) -> None: logger.info(msg, *args) +class StreamWrapper(StringIO): + orig_stream: TextIO + + @classmethod + def from_stream(cls, orig_stream: TextIO) -> "StreamWrapper": + ret = cls() + ret.orig_stream = orig_stream + return ret + + # compileall.compile_dir() needs stdout.encoding to print to stdout + # type ignore is because TextIOBase.encoding is writeable + @property + def encoding(self) -> str: # type: ignore + return self.orig_stream.encoding + + # Simulates an enum def enum(*sequential: Any, **named: Any) -> Type[Any]: enums = dict(zip(sequential, range(len(sequential))), **named) diff --git a/contrib/python/pip/pip/_vendor/dependency_groups/_implementation.py b/contrib/python/pip/pip/_vendor/dependency_groups/_implementation.py index 80d91693820..64e314a6328 100644 --- a/contrib/python/pip/pip/_vendor/dependency_groups/_implementation.py +++ b/contrib/python/pip/pip/_vendor/dependency_groups/_implementation.py @@ -12,7 +12,7 @@ def _normalize_name(name: str) -> str: def _normalize_group_names( - dependency_groups: Mapping[str, str | Mapping[str, str]] + dependency_groups: Mapping[str, str | Mapping[str, str]], ) -> Mapping[str, str | Mapping[str, str]]: original_names: dict[str, list[str]] = {} normalized_groups = {} @@ -171,17 +171,16 @@ class DependencyGroupResolver: if isinstance(item, Requirement): resolved_group.append(item) elif isinstance(item, DependencyGroupInclude): - if item.include_group in self._include_graph_ancestors.get(group, ()): + include_group = _normalize_name(item.include_group) + if include_group in self._include_graph_ancestors.get(group, ()): raise CyclicDependencyError( requested_group, group, item.include_group ) - self._include_graph_ancestors[item.include_group] = ( + self._include_graph_ancestors[include_group] = ( *self._include_graph_ancestors.get(group, ()), group, ) - resolved_group.extend( - self._resolve(item.include_group, requested_group) - ) + resolved_group.extend(self._resolve(include_group, requested_group)) else: # unreachable raise NotImplementedError( f"Invalid dependency group item after parse: {item}" @@ -206,8 +205,5 @@ def resolve( :raises LookupError: if group name is absent :raises packaging.requirements.InvalidRequirement: if a specifier is not valid """ - return tuple( - str(r) - for group in groups - for r in DependencyGroupResolver(dependency_groups).resolve(group) - ) + resolver = DependencyGroupResolver(dependency_groups) + return tuple(str(r) for group in groups for r in resolver.resolve(group)) diff --git a/contrib/python/pip/pip/_vendor/vendor.txt b/contrib/python/pip/pip/_vendor/vendor.txt index 283d57f5f34..b6597dc0022 100644 --- a/contrib/python/pip/pip/_vendor/vendor.txt +++ b/contrib/python/pip/pip/_vendor/vendor.txt @@ -17,4 +17,4 @@ setuptools==70.3.0 tomli==2.2.1 tomli-w==1.2.0 truststore==0.10.1 -dependency-groups==1.3.0 +dependency-groups==1.3.1 diff --git a/contrib/python/pip/ya.make b/contrib/python/pip/ya.make index 195518f4556..0a5893b069f 100644 --- a/contrib/python/pip/ya.make +++ b/contrib/python/pip/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(25.1) +VERSION(25.1.1) LICENSE(MIT) |
