Skip to content

Commit 9f72cd0

Browse files
authored
Merge pull request #11996 from uranusjr/deprecate-egg-importlib-metadata
2 parents 9fa6424 + 8295c99 commit 9f72cd0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

news/11996.process.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate support for eggs for Python 3.11 or later, when the new ``importlib.metadata`` backend is used to load distribution metadata. This only affects the egg *distribution format* (with the ``.egg`` extension); distributions using the ``.egg-info`` *metadata format* (but are not actually eggs) are not affected. For more information about eggs, see `relevant section in the setuptools documentation <https://setuptools.pypa.io/en/stable/deprecated/python_eggs.html>`__.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def _emit_egg_deprecation(location: Optional[str]) -> None:
151151
deprecated(
152152
reason=f"Loading egg at {location} is deprecated.",
153153
replacement="to use pip for package installation.",
154-
gone_in=None,
154+
gone_in="23.3",
155155
)
156156

157157

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

0 commit comments

Comments
 (0)