...
 
Commits (5)
    https://gitcode.net/awesome-mirrors/pypa/pip/-/commit/3eb3ddd873dfde2c146fcc5c82b2fa0ba363ac69 Fix slowness on Python 3.11 when updating an existing large environment. 2023-06-12T16:24:50+02:00 Maurits van Rees maurits@vanrees.org https://gitcode.net/awesome-mirrors/pypa/pip/-/commit/1269d0d240f4d22ed1134bb854bf2177a82a8d66 Update news snippet. 2023-06-12T16:31:28+02:00 Maurits van Rees maurits@vanrees.org https://gitcode.net/awesome-mirrors/pypa/pip/-/commit/1a80e41504008c8f3b63b5fb59c6b7476fcae3b9 Mention in changelog that 12079 is an issue mostly in Python 3.11. 2023-06-12T21:43:34+02:00 Maurits van Rees maurits@vanrees.org https://gitcode.net/awesome-mirrors/pypa/pip/-/commit/6aef9326d93dee61cb69cfa8770ca445891fa990 Update news/12079.bugfix.rst 2023-06-12T21:49:12+02:00 Maurits van Rees maurits@vanrees.org Co-authored-by: <span data-trailer="Co-authored-by:"><a href="mailto:uranusjr@gmail.com" title="uranusjr@gmail.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg3" style="text-decoration: none">N</a><a href="mailto:uranusjr@gmail.com" title="uranusjr@gmail.com">Tzu-ping Chung</a> &lt;<a href="mailto:uranusjr@gmail.com" title="uranusjr@gmail.com">uranusjr@gmail.com</a>&gt;</span> https://gitcode.net/awesome-mirrors/pypa/pip/-/commit/5190ef71cc77a6a6b8f40e4b1d78b4e6c35fe231 Merge pull request #12080 from mauritsvanrees/maurits-issue-12079-slow-importlib 2023-06-16T17:03:40+08:00 Tzu-ping Chung uranusjr@gmail.com
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.
......@@ -341,6 +341,7 @@ class AlreadyInstalledCandidate(Candidate):
self.dist = dist
self._ireq = _make_install_req_from_dist(dist, template)
self._factory = factory
self._version = None
# This is just logging some messages, so we can do it eagerly.
# The returned dist would be exactly the same as self.dist because we
......@@ -376,7 +377,9 @@ class AlreadyInstalledCandidate(Candidate):
@property
def version(self) -> CandidateVersion:
return self.dist.version
if self._version is None:
self._version = self.dist.version
return self._version
@property
def is_editable(self) -> bool:
......