Skip to content

Commit ba74f0e

Browse files
matteiusoz123
authored andcommitted
Vendor in pip==23.3.1
1 parent 50f0943 commit ba74f0e

Some content is hidden

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

43 files changed

+859
-583
lines changed

pipenv/patched/patched.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pip==24.2
1+
pip==24.3.1
22
safety==2.3.2

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.2"
3+
__version__ = "24.3.1"
44

55

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

pipenv/patched/pip/_internal/build_env.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ def _install_requirements(
242242
prefix.path,
243243
"--no-warn-script-location",
244244
"--disable-pip-version-check",
245+
# The prefix specified two lines above, thus
246+
# target from config file or env var should be ignored
247+
"--target",
248+
"",
245249
]
246250
if logger.getEffectiveLevel() <= logging.DEBUG:
247251
args.append("-vv")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class SessionCommandMixin(CommandContextMixIn):
5454

5555
def __init__(self) -> None:
5656
super().__init__()
57-
self._session: Optional["PipSession"] = None
57+
self._session: Optional[PipSession] = None
5858

5959
@classmethod
6060
def _get_index_urls(cls, options: Values) -> Optional[List[str]]:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import sys
77
import textwrap
88
from contextlib import suppress
9-
from typing import Any, Dict, Generator, List, Optional, Tuple
9+
from typing import Any, Dict, Generator, List, NoReturn, Optional, Tuple
1010

1111
from pipenv.patched.pip._internal.cli.status_codes import UNKNOWN_ERROR
1212
from pipenv.patched.pip._internal.configuration import Configuration, ConfigurationError
@@ -289,6 +289,6 @@ def get_default_values(self) -> optparse.Values:
289289
defaults[option.dest] = option.check_value(opt_str, default)
290290
return optparse.Values(defaults)
291291

292-
def error(self, msg: str) -> None:
292+
def error(self, msg: str) -> NoReturn:
293293
self.print_usage(sys.stderr)
294294
self.exit(UNKNOWN_ERROR, f"{msg}\n")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def _rich_progress_bar(
2525
iterable: Iterable[bytes],
2626
*,
2727
bar_type: str,
28-
size: int,
28+
size: Optional[int],
2929
) -> Generator[bytes, None, None]:
3030
assert bar_type == "on", "This should only be used in the default mode."
3131

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def run(self, options: Values, args: List[str]) -> int:
176176
if options.excludes:
177177
skip.update(canonicalize_name(n) for n in options.excludes)
178178

179-
packages: "_ProcessedDists" = [
179+
packages: _ProcessedDists = [
180180
cast("_DistWithLatestInfo", d)
181181
for d in get_environment(options.path).iter_installed_distributions(
182182
local_only=options.local,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def transform_hits(hits: List[Dict[str, str]]) -> List["TransformedHit"]:
8989
packages with the list of versions stored inline. This converts the
9090
list from pypi into one we can use.
9191
"""
92-
packages: Dict[str, "TransformedHit"] = OrderedDict()
92+
packages: Dict[str, TransformedHit] = OrderedDict()
9393
for hit in hits:
9494
name = hit["name"]
9595
summary = hit["summary"]

pipenv/patched/pip/_internal/exceptions.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
from itertools import chain, groupby, repeat
1616
from typing import TYPE_CHECKING, Dict, Iterator, List, Literal, Optional, Union
1717

18+
from pipenv.patched.pip._vendor.packaging.requirements import InvalidRequirement
19+
from pipenv.patched.pip._vendor.packaging.version import InvalidVersion
1820
from pipenv.patched.pip._vendor.rich.console import Console, ConsoleOptions, RenderResult
1921
from pipenv.patched.pip._vendor.rich.markup import escape
2022
from pipenv.patched.pip._vendor.rich.text import Text
@@ -429,7 +431,7 @@ class HashErrors(InstallationError):
429431
"""Multiple HashError instances rolled into one for reporting"""
430432

431433
def __init__(self) -> None:
432-
self.errors: List["HashError"] = []
434+
self.errors: List[HashError] = []
433435

434436
def append(self, error: "HashError") -> None:
435437
self.errors.append(error)
@@ -775,3 +777,33 @@ def __init__(self, *, distribution: "BaseDistribution") -> None:
775777
),
776778
hint_stmt=None,
777779
)
780+
781+
782+
class InvalidInstalledPackage(DiagnosticPipError):
783+
reference = "invalid-installed-package"
784+
785+
def __init__(
786+
self,
787+
*,
788+
dist: "BaseDistribution",
789+
invalid_exc: Union[InvalidRequirement, InvalidVersion],
790+
) -> None:
791+
installed_location = dist.installed_location
792+
793+
if isinstance(invalid_exc, InvalidRequirement):
794+
invalid_type = "requirement"
795+
else:
796+
invalid_type = "version"
797+
798+
super().__init__(
799+
message=Text(
800+
f"Cannot process installed package {dist} "
801+
+ (f"in {installed_location!r} " if installed_location else "")
802+
+ f"because it has an invalid {invalid_type}:\n{invalid_exc.args[0]}"
803+
),
804+
context=(
805+
"Starting with pip 24.1, packages with invalid "
806+
f"{invalid_type}s can not be processed."
807+
),
808+
hint_stmt="To proceed this package must be uninstalled.",
809+
)

pipenv/patched/pip/_internal/index/sources.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
from pipenv.patched.pip._vendor.packaging.utils import (
88
InvalidSdistFilename,
9-
InvalidVersion,
109
InvalidWheelFilename,
1110
canonicalize_name,
1211
parse_sdist_filename,
@@ -68,10 +67,10 @@ def _scan_directory(self) -> None:
6867
# otherwise not worth considering as a package
6968
try:
7069
project_filename = parse_wheel_filename(entry.name)[0]
71-
except (InvalidWheelFilename, InvalidVersion):
70+
except InvalidWheelFilename:
7271
try:
7372
project_filename = parse_sdist_filename(entry.name)[0]
74-
except (InvalidSdistFilename, InvalidVersion):
73+
except InvalidSdistFilename:
7574
continue
7675

7776
self._project_name_to_urls[project_filename].append(url)

0 commit comments

Comments
 (0)