Skip to content

Allow valid targets alongside empty directories - #22177

Open
nightcityblade wants to merge 1 commit into
python:masterfrom
nightcityblade:fix/issue-22173
Open

nightcityblade wants to merge 1 commit into
python:masterfrom
nightcityblade:fix/issue-22173

Conversation

@nightcityblade

Copy link
Copy Markdown

Fixes #22173

create_source_list now defers the existing empty-directory error until all explicit targets have been scanned. This lets mypy check valid targets alongside an empty directory while preserving the fatal error when no sources are found.

A regression test covers both the mixed-target and all-empty cases.

Validation:

  • TMPDIR=/tmp .venv/bin/python -m pytest -n0 mypy/test/test_find_sources.py -q (10 passed)
  • .venv/bin/python runtests.py lint (passed)
  • .venv/bin/python runtests.py self (346 source files checked successfully)
  • .venv/bin/python -m mypy .github . against the issue reproduction (success; 1 source file)

AI assistance: Codex helped draft the focused change and test; I reviewed the diff and ran all validation locally.

@github-actions

This comment has been minimized.

@nightcityblade

nightcityblade commented Oct 11, 2026 •

Copy link
Copy Markdown
Author

Fixed the Windows-only test expectation in 7d71289 by accepting both POSIX and drive-prefixed Windows separators. I also folded pre-commit.ci’s import-spacing auto-fix into the authored commit, preserving single-commit history. The focused 10-test suite passed before the formatting-only bot change; the final tree passes Ruff, ruff format, py_compile, and git diff --check. CI is rerunning.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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.

empty directory among multiple targets aborts whole check

1 participant