Skip to content

Commit dc58216

Browse files
committed
Remove support for installed eggs distributions
1 parent f6b445b commit dc58216

File tree

1 file changed

+0
-28
lines changed
  • src/pip/_internal/metadata/importlib

1 file changed

+0
-28
lines changed

src/pip/_internal/metadata/importlib/_envs.py

-28
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import functools
21
import importlib.metadata
32
import logging
43
import os
@@ -12,7 +11,6 @@
1211

1312
from pip._internal.metadata.base import BaseDistribution, BaseEnvironment
1413
from pip._internal.models.wheel import Wheel
15-
from pip._internal.utils.deprecation import deprecated
1614
from pip._internal.utils.filetypes import WHEEL_EXTENSION
1715

1816
from ._compat import BadMetadata, BasePath, get_dist_name, get_info_location
@@ -131,29 +129,6 @@ def _find_eggs_in_zip(self, location: str) -> Iterator[BaseDistribution]:
131129
for dist in find_eggs_in_zip(importer, location):
132130
yield legacy.Distribution(dist)
133131

134-
def find_eggs(self, location: str) -> Iterator[BaseDistribution]:
135-
"""Find eggs in a location.
136-
137-
This actually uses the old *pkg_resources* backend. We likely want to
138-
deprecate this so we can eventually remove the *pkg_resources*
139-
dependency entirely. Before that, this should first emit a deprecation
140-
warning for some versions when using the fallback since importing
141-
*pkg_resources* is slow for those who don't need it.
142-
"""
143-
if os.path.isdir(location):
144-
yield from self._find_eggs_in_dir(location)
145-
if zipfile.is_zipfile(location):
146-
yield from self._find_eggs_in_zip(location)
147-
148-
149-
@functools.lru_cache(maxsize=None) # Warn a distribution exactly once.
150-
def _emit_egg_deprecation(location: Optional[str]) -> None:
151-
deprecated(
152-
reason=f"Loading egg at {location} is deprecated.",
153-
replacement="to use pip for package installation.",
154-
gone_in="23.3",
155-
)
156-
157132

158133
class Environment(BaseEnvironment):
159134
def __init__(self, paths: Sequence[str]) -> None:
@@ -173,9 +148,6 @@ def _iter_distributions(self) -> Iterator[BaseDistribution]:
173148
finder = _DistributionFinder()
174149
for location in self._paths:
175150
yield from finder.find(location)
176-
for dist in finder.find_eggs(location):
177-
_emit_egg_deprecation(dist.location)
178-
yield dist
179151
# This must go last because that's how pkg_resources tie-breaks.
180152
yield from finder.find_linked(location)
181153

0 commit comments

Comments
 (0)