Skip to content

Conversation

@sirosen
Copy link
Member

@sirosen sirosen commented Jan 7, 2026

Rather than rebuilding the package finder, which seems to have a number of unexpected and undesirable side-effects, implement a safe way to clear the cache on a package finder.

A new regression test for #2220 validates the fix, demonstrating that we preserve the --extra-index-url provided via requirements.in.

This also fixes #2294 , for similar reasons.

This change was also manually tested on the reproducers from #2220 and #2294, where it has the correct effect.


The originating work where this bug was introduced comes from #2176, which was fixed in #2178 (and incorporated in #2195).
We were aware at the time that it wasn't clear what side-effects rebuilding the finder might have, but I considered it safe.
It has since turned out (#2220 and #2294) that we lose important information in the process -- we could reconstitute that information but this approach seems simpler.

Importantly, the new test would catch any future regression in this behavior.

Contributor checklist
  • Included tests for the changes.
  • A change note is created in changelog.d/ (see changelog.d/README.md for instructions) or the PR text says "no changelog needed".
Maintainer checklist
  • If no changelog is needed, apply the bot:chronographer:skip label.
  • Assign the PR to an existing or new milestone for the target version (following Semantic Versioning).

Rather than rebuilding the package finder, which seems to have a number
of unexpected and undesirable side-effects, implement a safe way to clear
the cache on a package finder.

A new regression test for jazzband#2220 validates the fix, demonstrating that we
preserve the `--extra-index-url` provided via `requirements.in`.

This also fixes jazzband#2294 , for similar reasons.

This change was also manually tested on the reproducers from jazzband#2220 and
 jazzband#2294, where it has the correct effect.
@sirosen sirosen added this to the 7.5.3 milestone Jan 7, 2026
@sirosen sirosen requested a review from webknjaz January 7, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IndexError when upgrading to Python 3.11 with rlextra

1 participant