Skip to content

Commit 97cc6a4

Browse files
authored
Merge branch 'main' into core_metadata
2 parents 7e3f74f + 9f72cd0 commit 97cc6a4

File tree

6 files changed

+9
-23
lines changed

6 files changed

+9
-23
lines changed

.github/workflows/no-response.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

NEWS.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Deprecations and Removals
5353
``--config-settings``. (`#11859 <https://github.com/pypa/pip/issues/11859>`_)
5454
- Using ``--config-settings`` with projects that don't have a ``pyproject.toml`` now prints
5555
a deprecation warning. In the future the presence of config settings will automatically
56-
enable the default build backend for legacy projects and pass the setttings to it. (`#11915 <https://github.com/pypa/pip/issues/11915>`_)
56+
enable the default build backend for legacy projects and pass the settings to it. (`#11915 <https://github.com/pypa/pip/issues/11915>`_)
5757
- Remove ``setup.py install`` fallback when building a wheel failed for projects without
5858
``pyproject.toml``. (`#8368 <https://github.com/pypa/pip/issues/8368>`_)
5959
- When the ``wheel`` package is not installed, pip now uses the default build backend

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>`__.

news/12079.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix slowness when using ``importlib.metadata`` (the default way for pip to read metadata in Python 3.11+) and there is a large overlap between already installed and to-be-installed packages.

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)

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,7 @@ def __init__(
341341
self.dist = dist
342342
self._ireq = _make_install_req_from_dist(dist, template)
343343
self._factory = factory
344+
self._version = None
344345

345346
# This is just logging some messages, so we can do it eagerly.
346347
# The returned dist would be exactly the same as self.dist because we
@@ -376,7 +377,9 @@ def name(self) -> str:
376377

377378
@property
378379
def version(self) -> CandidateVersion:
379-
return self.dist.version
380+
if self._version is None:
381+
self._version = self.dist.version
382+
return self._version
380383

381384
@property
382385
def is_editable(self) -> bool:

0 commit comments

Comments
 (0)