Skip to content

🐛 fix(seed): skip --extra-search-dir entries that are files - #3688

Closed
gaborbernat wants to merge 14 commits into
pypa:mainfrom
Pratik-Kumar-Dhakar:fix/extra-search-dir-file
Closed

gaborbernat wants to merge 14 commits into
pypa:mainfrom
Pratik-Kumar-Dhakar:fix/extra-search-dir-file

Conversation

@gaborbernat

Copy link
Copy Markdown
Contributor

Fixes #3582.

--extra-search-dir takes directories containing wheels. Passing a file previously reached wheel discovery, where iterdir() raised NotADirectoryError and seeding reported a download failure. File paths now get skipped, like missing paths.

The seeder filters non-directories before wheel lookup for both app-data and pip seeding. Valid directories remain in the configured search order.

Contributor checklist

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are tests validating the fix
  • added a docs/changelog/+short-description.<type>.rst fragment for the user-facing change
  • updated or extended the documentation
  • explained the outside input: a file path supplied to --extra-search-dir
  • ran affected tests on Python 3.9 and 3.15
  • linked upstream issues beside any temporary interpreter overrides
  • kept the PR in draft until CI passes

Replaces #3587 after its merge was reverted.

gaborbernat and others added 14 commits November 19, 2026 22:36
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Pin the pre-commit hook to [simplint
0.14.2](https://github.com/gaborbernat/simplint/releases/tag/0.14.2).
This release starts larger files earlier during parallel checks and
sizes cache reads to the archive on disk.

Give bare `Final` annotations explicit types across virtualenv,
maintenance tasks and tests. The wheel installer also declares its lazy
`posixpath` import. Refresh the CodeQL mutant patches for the new
annotations.

The macOS GraalPy reseeding test timed out while uninstalling pip.
Collect each package directory once when cleaning up files from pip's
RECORD. The test also uses the existing fixture that keeps coverage out
of pip's subprocesses.
A file passed the existence check, then wheel discovery called iterdir()
and failed. Keep only directories so a file input is ignored like a
missing path.

Fixes pypa#3582
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--extra-search-dir pointing at a file crashes seeding with a misleading download error

2 participants