Skip to content

Commit 6e547d8

Browse files
authored
Merge pull request #13313 from pfmoore/vendoring-25.1
Vendoring updates for release 25.1
2 parents eb9bef9 + 3427d96 commit 6e547d8

18 files changed

+1244
-176
lines changed

news/platformdirs.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade platformdirs to 4.3.7

news/rich.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade rich to 14.0.0

news/typing_extensions.vendor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Upgrade typing_extensions to 4.13.2

src/pip/_vendor/README.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,16 @@ Vendoring is automated via the `vendoring <https://pypi.org/project/vendoring/>`
115115
Launch it via ``vendoring sync . -v`` (requires ``vendoring>=0.2.2``).
116116
Tool configuration is done via ``pyproject.toml``.
117117

118+
To update the vendored library versions, we have a session defined in ``nox``.
119+
The command to upgrade everything is::
120+
121+
nox -s vendoring -- --upgrade-all --skip urllib3 --skip setuptools
122+
123+
At the time of writing (April 2025) we do not upgrade ``urllib3`` because the
124+
next version is a major upgrade and will be handled as an independent PR. We also
125+
do not upgrade ``setuptools``, because we only rely on ``pkg_resources``, and
126+
tracking every ``setuptools`` change is unnecessary for our needs.
127+
118128

119129
Managing Local Patches
120130
======================

src/pip/_vendor/platformdirs/__init__.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def _set_platform_dir_class() -> type[PlatformDirsABC]:
5252

5353
def user_data_dir(
5454
appname: str | None = None,
55-
appauthor: str | None | Literal[False] = None,
55+
appauthor: str | Literal[False] | None = None,
5656
version: str | None = None,
5757
roaming: bool = False, # noqa: FBT001, FBT002
5858
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -76,7 +76,7 @@ def user_data_dir(
7676

7777
def site_data_dir(
7878
appname: str | None = None,
79-
appauthor: str | None | Literal[False] = None,
79+
appauthor: str | Literal[False] | None = None,
8080
version: str | None = None,
8181
multipath: bool = False, # noqa: FBT001, FBT002
8282
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -100,7 +100,7 @@ def site_data_dir(
100100

101101
def user_config_dir(
102102
appname: str | None = None,
103-
appauthor: str | None | Literal[False] = None,
103+
appauthor: str | Literal[False] | None = None,
104104
version: str | None = None,
105105
roaming: bool = False, # noqa: FBT001, FBT002
106106
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -124,7 +124,7 @@ def user_config_dir(
124124

125125
def site_config_dir(
126126
appname: str | None = None,
127-
appauthor: str | None | Literal[False] = None,
127+
appauthor: str | Literal[False] | None = None,
128128
version: str | None = None,
129129
multipath: bool = False, # noqa: FBT001, FBT002
130130
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -148,7 +148,7 @@ def site_config_dir(
148148

149149
def user_cache_dir(
150150
appname: str | None = None,
151-
appauthor: str | None | Literal[False] = None,
151+
appauthor: str | Literal[False] | None = None,
152152
version: str | None = None,
153153
opinion: bool = True, # noqa: FBT001, FBT002
154154
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -172,7 +172,7 @@ def user_cache_dir(
172172

173173
def site_cache_dir(
174174
appname: str | None = None,
175-
appauthor: str | None | Literal[False] = None,
175+
appauthor: str | Literal[False] | None = None,
176176
version: str | None = None,
177177
opinion: bool = True, # noqa: FBT001, FBT002
178178
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -196,7 +196,7 @@ def site_cache_dir(
196196

197197
def user_state_dir(
198198
appname: str | None = None,
199-
appauthor: str | None | Literal[False] = None,
199+
appauthor: str | Literal[False] | None = None,
200200
version: str | None = None,
201201
roaming: bool = False, # noqa: FBT001, FBT002
202202
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -220,7 +220,7 @@ def user_state_dir(
220220

221221
def user_log_dir(
222222
appname: str | None = None,
223-
appauthor: str | None | Literal[False] = None,
223+
appauthor: str | Literal[False] | None = None,
224224
version: str | None = None,
225225
opinion: bool = True, # noqa: FBT001, FBT002
226226
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -274,7 +274,7 @@ def user_desktop_dir() -> str:
274274

275275
def user_runtime_dir(
276276
appname: str | None = None,
277-
appauthor: str | None | Literal[False] = None,
277+
appauthor: str | Literal[False] | None = None,
278278
version: str | None = None,
279279
opinion: bool = True, # noqa: FBT001, FBT002
280280
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -298,7 +298,7 @@ def user_runtime_dir(
298298

299299
def site_runtime_dir(
300300
appname: str | None = None,
301-
appauthor: str | None | Literal[False] = None,
301+
appauthor: str | Literal[False] | None = None,
302302
version: str | None = None,
303303
opinion: bool = True, # noqa: FBT001, FBT002
304304
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -322,7 +322,7 @@ def site_runtime_dir(
322322

323323
def user_data_path(
324324
appname: str | None = None,
325-
appauthor: str | None | Literal[False] = None,
325+
appauthor: str | Literal[False] | None = None,
326326
version: str | None = None,
327327
roaming: bool = False, # noqa: FBT001, FBT002
328328
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -346,7 +346,7 @@ def user_data_path(
346346

347347
def site_data_path(
348348
appname: str | None = None,
349-
appauthor: str | None | Literal[False] = None,
349+
appauthor: str | Literal[False] | None = None,
350350
version: str | None = None,
351351
multipath: bool = False, # noqa: FBT001, FBT002
352352
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -370,7 +370,7 @@ def site_data_path(
370370

371371
def user_config_path(
372372
appname: str | None = None,
373-
appauthor: str | None | Literal[False] = None,
373+
appauthor: str | Literal[False] | None = None,
374374
version: str | None = None,
375375
roaming: bool = False, # noqa: FBT001, FBT002
376376
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -394,7 +394,7 @@ def user_config_path(
394394

395395
def site_config_path(
396396
appname: str | None = None,
397-
appauthor: str | None | Literal[False] = None,
397+
appauthor: str | Literal[False] | None = None,
398398
version: str | None = None,
399399
multipath: bool = False, # noqa: FBT001, FBT002
400400
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -418,7 +418,7 @@ def site_config_path(
418418

419419
def site_cache_path(
420420
appname: str | None = None,
421-
appauthor: str | None | Literal[False] = None,
421+
appauthor: str | Literal[False] | None = None,
422422
version: str | None = None,
423423
opinion: bool = True, # noqa: FBT001, FBT002
424424
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -442,7 +442,7 @@ def site_cache_path(
442442

443443
def user_cache_path(
444444
appname: str | None = None,
445-
appauthor: str | None | Literal[False] = None,
445+
appauthor: str | Literal[False] | None = None,
446446
version: str | None = None,
447447
opinion: bool = True, # noqa: FBT001, FBT002
448448
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -466,7 +466,7 @@ def user_cache_path(
466466

467467
def user_state_path(
468468
appname: str | None = None,
469-
appauthor: str | None | Literal[False] = None,
469+
appauthor: str | Literal[False] | None = None,
470470
version: str | None = None,
471471
roaming: bool = False, # noqa: FBT001, FBT002
472472
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -490,7 +490,7 @@ def user_state_path(
490490

491491
def user_log_path(
492492
appname: str | None = None,
493-
appauthor: str | None | Literal[False] = None,
493+
appauthor: str | Literal[False] | None = None,
494494
version: str | None = None,
495495
opinion: bool = True, # noqa: FBT001, FBT002
496496
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -544,7 +544,7 @@ def user_desktop_path() -> Path:
544544

545545
def user_runtime_path(
546546
appname: str | None = None,
547-
appauthor: str | None | Literal[False] = None,
547+
appauthor: str | Literal[False] | None = None,
548548
version: str | None = None,
549549
opinion: bool = True, # noqa: FBT001, FBT002
550550
ensure_exists: bool = False, # noqa: FBT001, FBT002
@@ -568,7 +568,7 @@ def user_runtime_path(
568568

569569
def site_runtime_path(
570570
appname: str | None = None,
571-
appauthor: str | None | Literal[False] = None,
571+
appauthor: str | Literal[False] | None = None,
572572
version: str | None = None,
573573
opinion: bool = True, # noqa: FBT001, FBT002
574574
ensure_exists: bool = False, # noqa: FBT001, FBT002

src/pip/_vendor/platformdirs/android.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Android(PlatformDirsABC):
2323
@property
2424
def user_data_dir(self) -> str:
2525
""":return: data directory tied to the user, e.g. ``/data/user/<userid>/<packagename>/files/<AppName>``"""
26-
return self._append_app_name_and_version(cast(str, _android_folder()), "files")
26+
return self._append_app_name_and_version(cast("str", _android_folder()), "files")
2727

2828
@property
2929
def site_data_dir(self) -> str:
@@ -36,7 +36,7 @@ def user_config_dir(self) -> str:
3636
:return: config directory tied to the user, e.g. \
3737
``/data/user/<userid>/<packagename>/shared_prefs/<AppName>``
3838
"""
39-
return self._append_app_name_and_version(cast(str, _android_folder()), "shared_prefs")
39+
return self._append_app_name_and_version(cast("str", _android_folder()), "shared_prefs")
4040

4141
@property
4242
def site_config_dir(self) -> str:
@@ -46,7 +46,7 @@ def site_config_dir(self) -> str:
4646
@property
4747
def user_cache_dir(self) -> str:
4848
""":return: cache directory tied to the user, e.g.,``/data/user/<userid>/<packagename>/cache/<AppName>``"""
49-
return self._append_app_name_and_version(cast(str, _android_folder()), "cache")
49+
return self._append_app_name_and_version(cast("str", _android_folder()), "cache")
5050

5151
@property
5252
def site_cache_dir(self) -> str:

src/pip/_vendor/platformdirs/api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from typing import TYPE_CHECKING
99

1010
if TYPE_CHECKING:
11-
from typing import Iterator, Literal
11+
from collections.abc import Iterator
12+
from typing import Literal
1213

1314

1415
class PlatformDirsABC(ABC): # noqa: PLR0904
@@ -17,7 +18,7 @@ class PlatformDirsABC(ABC): # noqa: PLR0904
1718
def __init__( # noqa: PLR0913, PLR0917
1819
self,
1920
appname: str | None = None,
20-
appauthor: str | None | Literal[False] = None,
21+
appauthor: str | Literal[False] | None = None,
2122
version: str | None = None,
2223
roaming: bool = False, # noqa: FBT001, FBT002
2324
multipath: bool = False, # noqa: FBT001, FBT002

src/pip/_vendor/platformdirs/unix.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
import sys
77
from configparser import ConfigParser
88
from pathlib import Path
9-
from typing import Iterator, NoReturn
9+
from typing import TYPE_CHECKING, NoReturn
1010

1111
from .api import PlatformDirsABC
1212

13+
if TYPE_CHECKING:
14+
from collections.abc import Iterator
15+
1316
if sys.platform == "win32":
1417

1518
def getuid() -> NoReturn:
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
# file generated by setuptools_scm
1+
# file generated by setuptools-scm
22
# don't change, don't track in version control
3+
4+
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5+
36
TYPE_CHECKING = False
47
if TYPE_CHECKING:
5-
from typing import Tuple, Union
8+
from typing import Tuple
9+
from typing import Union
10+
611
VERSION_TUPLE = Tuple[Union[int, str], ...]
712
else:
813
VERSION_TUPLE = object
@@ -12,5 +17,5 @@
1217
__version_tuple__: VERSION_TUPLE
1318
version_tuple: VERSION_TUPLE
1419

15-
__version__ = version = '4.3.6'
16-
__version_tuple__ = version_tuple = (4, 3, 6)
20+
__version__ = version = '4.3.7'
21+
__version_tuple__ = version_tuple = (4, 3, 7)

src/pip/_vendor/rich/console.py

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ def group(fit: bool = True) -> Callable[..., Callable[..., Group]]:
500500
"""
501501

502502
def decorator(
503-
method: Callable[..., Iterable[RenderableType]]
503+
method: Callable[..., Iterable[RenderableType]],
504504
) -> Callable[..., Group]:
505505
"""Convert a method that returns an iterable of renderables in to a Group."""
506506

@@ -735,7 +735,9 @@ def __init__(
735735
self.get_time = get_time or monotonic
736736
self.style = style
737737
self.no_color = (
738-
no_color if no_color is not None else "NO_COLOR" in self._environ
738+
no_color
739+
if no_color is not None
740+
else self._environ.get("NO_COLOR", "") != ""
739741
)
740742
self.is_interactive = (
741743
(self.is_terminal and not self.is_dumb_terminal)
@@ -933,11 +935,13 @@ def is_terminal(self) -> bool:
933935
934936
Returns:
935937
bool: True if the console writing to a device capable of
936-
understanding terminal codes, otherwise False.
938+
understanding escape sequences, otherwise False.
937939
"""
940+
# If dev has explicitly set this value, return it
938941
if self._force_terminal is not None:
939942
return self._force_terminal
940943

944+
# Fudge for Idle
941945
if hasattr(sys.stdin, "__module__") and sys.stdin.__module__.startswith(
942946
"idlelib"
943947
):
@@ -948,12 +952,22 @@ def is_terminal(self) -> bool:
948952
# return False for Jupyter, which may have FORCE_COLOR set
949953
return False
950954

951-
# If FORCE_COLOR env var has any value at all, we assume a terminal.
952-
force_color = self._environ.get("FORCE_COLOR")
953-
if force_color is not None:
954-
self._force_terminal = True
955+
environ = self._environ
956+
957+
tty_compatible = environ.get("TTY_COMPATIBLE", "")
958+
# 0 indicates device is not tty compatible
959+
if tty_compatible == "0":
960+
return False
961+
# 1 indicates device is tty compatible
962+
if tty_compatible == "1":
955963
return True
956964

965+
# https://force-color.org/
966+
force_color = environ.get("FORCE_COLOR")
967+
if force_color is not None:
968+
return force_color != ""
969+
970+
# Any other value defaults to auto detect
957971
isatty: Optional[Callable[[], bool]] = getattr(self.file, "isatty", None)
958972
try:
959973
return False if isatty is None else isatty()

src/pip/_vendor/rich/default_styles.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,9 @@
120120
"traceback.exc_type": Style(color="bright_red", bold=True),
121121
"traceback.exc_value": Style.null(),
122122
"traceback.offset": Style(color="bright_red", bold=True),
123-
"traceback.error_range": Style(underline=True, bold=True, dim=False),
123+
"traceback.error_range": Style(underline=True, bold=True),
124+
"traceback.note": Style(color="green", bold=True),
125+
"traceback.group.border": Style(color="magenta"),
124126
"bar.back": Style(color="grey23"),
125127
"bar.complete": Style(color="rgb(249,38,114)"),
126128
"bar.finished": Style(color="rgb(114,156,31)"),

src/pip/_vendor/rich/diagnose.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ def report() -> None: # pragma: no cover
1515
inspect(features)
1616

1717
env_names = (
18-
"TERM",
19-
"COLORTERM",
2018
"CLICOLOR",
21-
"NO_COLOR",
22-
"TERM_PROGRAM",
19+
"COLORTERM",
2320
"COLUMNS",
24-
"LINES",
21+
"JPY_PARENT_PID",
2522
"JUPYTER_COLUMNS",
2623
"JUPYTER_LINES",
27-
"JPY_PARENT_PID",
24+
"LINES",
25+
"NO_COLOR",
26+
"TERM_PROGRAM",
27+
"TERM",
28+
"TTY_COMPATIBLE",
2829
"VSCODE_VERBOSE_LOGGING",
2930
)
3031
env = {name: os.getenv(name) for name in env_names}

src/pip/_vendor/rich/panel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Panel(JupyterMixin):
2222
2323
Args:
2424
renderable (RenderableType): A console renderable object.
25-
box (Box, optional): A Box instance that defines the look of the border (see :ref:`appendix_box`. Defaults to box.ROUNDED.
25+
box (Box): A Box instance that defines the look of the border (see :ref:`appendix_box`. Defaults to box.ROUNDED.
2626
title (Optional[TextType], optional): Optional title displayed in panel header. Defaults to None.
2727
title_align (AlignMethod, optional): Alignment of title. Defaults to "center".
2828
subtitle (Optional[TextType], optional): Optional subtitle displayed in panel footer. Defaults to None.

0 commit comments

Comments
 (0)