Skip to content

Commit e74c2d7

Browse files
authored
Revert _log_skipped_link() optimization (#13333)
The addition of if not logger.isEnabledFor(logging.DEBUG) in _log_skipped_link() means that skipped links are not stored, preventing requires_python_skipped_reasons() from ever returning anything.
1 parent 84b09d0 commit e74c2d7

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

news/13333.bugfix.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix regression that suppressed errors indicating which packages were ignored
2+
due to incompatible ``requires-python`` metadata.

src/pip/_internal/index/package_finder.py

-5
Original file line numberDiff line numberDiff line change
@@ -732,11 +732,6 @@ def _sort_links(self, links: Iterable[Link]) -> List[Link]:
732732
return no_eggs + eggs
733733

734734
def _log_skipped_link(self, link: Link, result: LinkType, detail: str) -> None:
735-
# This is a hot method so don't waste time hashing links unless we're
736-
# actually going to log 'em.
737-
if not logger.isEnabledFor(logging.DEBUG):
738-
return
739-
740735
entry = (link, result, detail)
741736
if entry not in self._logged_links:
742737
# Put the link at the end so the reason is more visible and because

0 commit comments

Comments
 (0)