Skip to content

Commit 828a7d3

Browse files
committed
Remove various extras normalization workarounds
1 parent fd89669 commit 828a7d3

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

src/pip/_internal/req/req_install.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
is_installable_dir,
5252
redact_auth_from_url,
5353
)
54-
from pip._internal.utils.packaging import safe_extra
5554
from pip._internal.utils.subprocess import runner_with_spinner_message
5655
from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds
5756
from pip._internal.utils.unpacking import unpack_file
@@ -272,12 +271,7 @@ def match_markers(self, extras_requested: Optional[Iterable[str]] = None) -> boo
272271
extras_requested = ("",)
273272
if self.markers is not None:
274273
return any(
275-
self.markers.evaluate({"extra": extra})
276-
# TODO: Remove these two variants when packaging is upgraded to
277-
# support the marker comparison logic specified in PEP 685.
278-
or self.markers.evaluate({"extra": safe_extra(extra)})
279-
or self.markers.evaluate({"extra": canonicalize_name(extra)})
280-
for extra in extras_requested
274+
self.markers.evaluate({"extra": extra}) for extra in extras_requested
281275
)
282276
else:
283277
return True

src/pip/_internal/resolution/resolvelib/candidates.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,6 @@ def __init__(
430430
) -> None:
431431
self.base = base
432432
self.extras = frozenset(canonicalize_name(e) for e in extras)
433-
# If any extras are requested in their non-normalized forms, keep track
434-
# of their raw values. This is needed when we look up dependencies
435-
# since PEP 685 has not been implemented for marker-matching, and using
436-
# the non-normalized extra for lookup ensures the user can select a
437-
# non-normalized extra in a package with its non-normalized form.
438-
# TODO: Remove this attribute when packaging is upgraded to support the
439-
# marker comparison logic specified in PEP 685.
440-
self._unnormalized_extras = extras.difference(self.extras)
441433

442434
def __str__(self) -> str:
443435
name, rest = str(self.base).split(" ", 1)
@@ -523,7 +515,7 @@ def _calculate_valid_requested_extras(self) -> FrozenSet[str]:
523515
candidate doesn't support. Any unsupported extras are dropped, and each
524516
cause a warning to be logged here.
525517
"""
526-
requested_extras = self.extras.union(self._unnormalized_extras)
518+
requested_extras = self.extras
527519
valid_extras = frozenset(
528520
extra
529521
for extra in requested_extras

0 commit comments

Comments
 (0)