Skip to content

Commit

Permalink
Deprecate .egg in the imporlib-metadata backend
Browse files Browse the repository at this point in the history
This provides us a path to remove all pkg_resources usages on Python
3.11 or later, and thus avoid the problem that pkg_resources uses
Python API deprecated in 3.12.
  • Loading branch information
uranusjr committed Apr 24, 2023
1 parent 51afe45 commit 81a593c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pip/_internal/metadata/importlib/_envs.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _emit_egg_deprecation(location: Optional[str]) -> None:
deprecated(
reason=f"Loading egg at {location} is deprecated.",
replacement="to use pip for package installation.",
gone_in=None,
gone_in="23.3",
)


Expand All @@ -174,7 +174,7 @@ def _iter_distributions(self) -> Iterator[BaseDistribution]:
for location in self._paths:
yield from finder.find(location)
for dist in finder.find_eggs(location):
# _emit_egg_deprecation(dist.location) # TODO: Enable this.
_emit_egg_deprecation(dist.location)
yield dist
# This must go last because that's how pkg_resources tie-breaks.
yield from finder.find_linked(location)
Expand Down

0 comments on commit 81a593c

Please sign in to comment.