Skip to content

Commit 1cf036a

Browse files
authored
Vendor pip 25.0.1 (#6343)
* Vendor in pip==25.0.1 * Update the InstallRequirement api usage as its changed in pip 25.
1 parent 56d4535 commit 1cf036a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+14369
-12773
lines changed

pipenv/patched/patched.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pip==24.3.1
1+
pip==25.0.1

pipenv/patched/pip/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import List, Optional
22

3-
__version__ = "24.3.1"
3+
__version__ = "25.0.1"
44

55

66
def main(args: Optional[List[str]] = None) -> int:

pipenv/patched/pip/_internal/build_env.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from types import TracebackType
1212
from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Type, Union
1313

14-
from pipenv.patched.pip._vendor.certifi import where
1514
from pipenv.patched.pip._vendor.packaging.version import Version
1615

1716
from pipenv.patched.pip import __file__ as pip_location
@@ -270,21 +269,25 @@ def _install_requirements(
270269
for link in finder.find_links:
271270
args.extend(["--find-links", link])
272271

272+
if finder.proxy:
273+
args.extend(["--proxy", finder.proxy])
273274
for host in finder.trusted_hosts:
274275
args.extend(["--trusted-host", host])
276+
if finder.custom_cert:
277+
args.extend(["--cert", finder.custom_cert])
278+
if finder.client_cert:
279+
args.extend(["--client-cert", finder.client_cert])
275280
if finder.allow_all_prereleases:
276281
args.append("--pre")
277282
if finder.prefer_binary:
278283
args.append("--prefer-binary")
279284
args.append("--")
280285
args.extend(requirements)
281-
extra_environ = {"_PIP_STANDALONE_CERT": where()}
282286
with open_spinner(f"Installing {kind}") as spinner:
283287
call_subprocess(
284288
args,
285289
command_desc=f"pip subprocess to install {kind}",
286290
spinner=spinner,
287-
extra_environ=extra_environ,
288291
)
289292

290293

pipenv/patched/pip/_internal/cli/base_command.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
NetworkConnectionError,
3030
PreviousBuildDirError,
3131
)
32+
from pipenv.patched.pip._internal.utils.deprecation import deprecated
3233
from pipenv.patched.pip._internal.utils.filesystem import check_path_owner
3334
from pipenv.patched.pip._internal.utils.logging import BrokenStdoutLoggingError, setup_logging
3435
from pipenv.patched.pip._internal.utils.misc import get_prog, normalize_path
@@ -228,4 +229,12 @@ def _main(self, args: List[str]) -> int:
228229
)
229230
options.cache_dir = None
230231

232+
if options.no_python_version_warning:
233+
deprecated(
234+
reason="--no-python-version-warning is deprecated.",
235+
replacement="to remove the flag as it's a no-op",
236+
gone_in="25.1",
237+
issue=13154,
238+
)
239+
231240
return self._run_wrapper(level_number, options, args)

pipenv/patched/pip/_internal/cli/cmdoptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ class PipOption(Option):
260260
default="auto",
261261
help=(
262262
"Enable the credential lookup via the keyring library if user input is allowed."
263-
" Specify which mechanism to use [disabled, import, subprocess]."
264-
" (default: disabled)"
263+
" Specify which mechanism to use [auto, disabled, import, subprocess]."
264+
" (default: %default)"
265265
),
266266
)
267267

pipenv/patched/pip/_internal/cli/index_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ def _build_session(
123123
"https": options.proxy,
124124
}
125125
session.trust_env = False
126+
session.pip_proxy = options.proxy
126127

127128
# Determine if we can prompt the user for authentication or not
128129
session.auth.prompting = not options.no_input

pipenv/patched/pip/_internal/cli/progress_bars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def _raw_progress_bar(
6363
size: Optional[int],
6464
) -> Generator[bytes, None, None]:
6565
def write_progress(current: int, total: int) -> None:
66-
sys.stdout.write("Progress %d of %d\n" % (current, total))
66+
sys.stdout.write(f"Progress {current} of {total}\n")
6767
sys.stdout.flush()
6868

6969
current = 0

pipenv/patched/pip/_internal/commands/cache.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from pipenv.patched.pip._internal.exceptions import CommandError, PipError
99
from pipenv.patched.pip._internal.utils import filesystem
1010
from pipenv.patched.pip._internal.utils.logging import getLogger
11+
from pipenv.patched.pip._internal.utils.misc import format_size
1112

1213
logger = getLogger(__name__)
1314

@@ -180,10 +181,12 @@ def remove_cache_items(self, options: Values, args: List[Any]) -> None:
180181
if not files:
181182
logger.warning(no_matching_msg)
182183

184+
bytes_removed = 0
183185
for filename in files:
186+
bytes_removed += os.stat(filename).st_size
184187
os.unlink(filename)
185188
logger.verbose("Removed %s", filename)
186-
logger.info("Files removed: %s", len(files))
189+
logger.info("Files removed: %s (%s)", len(files), format_size(bytes_removed))
187190

188191
def purge_cache(self, options: Values, args: List[Any]) -> None:
189192
if args:

pipenv/patched/pip/_internal/commands/install.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
from pipenv.patched.pip._vendor.packaging.utils import canonicalize_name
1111
from pipenv.patched.pip._vendor.rich import print_json
1212

13+
# Eagerly import self_outdated_check to avoid crashes. Otherwise,
14+
# this module would be imported *after* pip was replaced, resulting
15+
# in crashes if the new self_outdated_check module was incompatible
16+
# with the rest of pip that's already imported, or allowing a
17+
# wheel to execute arbitrary code on install by replacing
18+
# self_outdated_check.
19+
import pipenv.patched.pip._internal.self_outdated_check # noqa: F401
1320
from pipenv.patched.pip._internal.cache import WheelCache
1421
from pipenv.patched.pip._internal.cli import cmdoptions
1522
from pipenv.patched.pip._internal.cli.cmdoptions import make_target_python
@@ -408,12 +415,6 @@ def run(self, options: Values, args: List[str]) -> int:
408415
# If we're not replacing an already installed pip,
409416
# we're not modifying it.
410417
modifying_pip = pip_req.satisfied_by is None
411-
if modifying_pip:
412-
# Eagerly import this module to avoid crashes. Otherwise, this
413-
# module would be imported *after* pip was replaced, resulting in
414-
# crashes if the new self_outdated_check module was incompatible
415-
# with the rest of pip that's already imported.
416-
import pipenv.patched.pip._internal.self_outdated_check # noqa: F401
417418
protect_pip_from_modification_on_windows(modifying_pip=modifying_pip)
418419

419420
reqs_to_build = [
@@ -432,7 +433,7 @@ def run(self, options: Values, args: List[str]) -> int:
432433

433434
if build_failures:
434435
raise InstallationError(
435-
"ERROR: Failed to build installable wheels for some "
436+
"Failed to build installable wheels for some "
436437
"pyproject.toml based projects ({})".format(
437438
", ".join(r.name for r in build_failures) # type: ignore
438439
)

pipenv/patched/pip/_internal/commands/show.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class _PackageInfo(NamedTuple):
6666
author: str
6767
author_email: str
6868
license: str
69+
license_expression: str
6970
entry_points: List[str]
7071
files: Optional[List[str]]
7172

@@ -161,6 +162,7 @@ def _get_requiring_packages(current_dist: BaseDistribution) -> Iterator[str]:
161162
author=metadata.get("Author", ""),
162163
author_email=metadata.get("Author-email", ""),
163164
license=metadata.get("License", ""),
165+
license_expression=metadata.get("License-Expression", ""),
164166
entry_points=entry_points,
165167
files=files,
166168
)
@@ -180,13 +182,18 @@ def print_results(
180182
if i > 0:
181183
write_output("---")
182184

185+
metadata_version_tuple = tuple(map(int, dist.metadata_version.split(".")))
186+
183187
write_output("Name: %s", dist.name)
184188
write_output("Version: %s", dist.version)
185189
write_output("Summary: %s", dist.summary)
186190
write_output("Home-page: %s", dist.homepage)
187191
write_output("Author: %s", dist.author)
188192
write_output("Author-email: %s", dist.author_email)
189-
write_output("License: %s", dist.license)
193+
if metadata_version_tuple >= (2, 4) and dist.license_expression:
194+
write_output("License-Expression: %s", dist.license_expression)
195+
else:
196+
write_output("License: %s", dist.license)
190197
write_output("Location: %s", dist.location)
191198
if dist.editable_project_location is not None:
192199
write_output(

0 commit comments

Comments
 (0)