8000 Fix crash with `pip==25.1`, which changed caching for find_all_candidates by gkreitz · Pull Request #2178 · jazzband/pip-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

Fix crash with pip==25.1, which changed caching for find_all_candidates #2178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,6 @@ This will be indicated in the output with one of the following suffixes:
- [pip-compile-multi](https://pip-compile-multi.readthedocs.io/en/latest/) - pip-compile command wrapper for multiple cross-referencing requirements files.
- [pipdeptree](https://github.com/tox-dev/pipdeptree) to print the dependency tree of the installed packages.
- `requirements.in`/`requirements.txt` syntax highlighting:

- [requirements.txt.vim](https://github.com/raimon49/requirements.txt.vim) for Vim.
- [Python extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-python.python) for VS Code.
- [pip-requirements.el](https://github.com/Wilfred/pip-requirements.el) for Emacs.
Expand Down
10 changes: 7 additions & 3 deletions piptools/repositories/pypi.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,9 +447,13 @@ def _wheel_support_index_min(self: Wheel, tags: list[Tag]) -> int:
Wheel.support_index_min = _wheel_support_index_min
self._available_candidates_cache = {}

# If we don't clear this cache then it can contain results from an
# earlier call when allow_all_wheels wasn't active. See GH-1532
self.finder.find_all_candidates.cache_clear()
# Finder internally caches results, and there is no public method to
# clear the cache, so we re-create the object here. If we don't clear
# this cache then it can contain results from an earlier call when
# allow_all_wheels wasn't active. See GH-1532
self._finder = self.command._build_package_finder(
options=self.options, session=self.session
)

try:
yield
Expand Down
Loading
0