You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decide the Python Directory Gate's Behavior-Changing Edge Cases #1936
These items were split off #1917 because each one changes what the Python directory gate accepts or runs. The prose and small code fixes from that issue were handled separately. Item numbers are #1917's own.
mypy on a declared pip directory (item 2). The command-line --python-version overrides a python_version the repo pins in its own mypy config. mypy running under uvx also cannot import a plugin that is installed only in .venv.
Type-checker config only at the root (item 3). The checker lookup reads only the declared directory. So a monorepo that keeps [tool.mypy] or [tool.pyright] in the root pyproject.toml fails with "configures neither".
unittest discovery (item 4).discover -s tests exits 5 on pytest-style plain test functions, and no message explains why. It also silently skips a nested test directory that has no __init__.py.
Name-matched test modules (item 5). The lint-only exclusion is gone. A python-typed lint-only repo holding a script that is merely named test_*.py now owes a Codecov claim.
The audit's caller check (item 9). It reads only a job keyed validate. A renamed job, or a flow-mapping with: { python-directories: X }, is skipped or misread.
Caller-level selftest cases (item 14). The audit selftest now checks declared_types() directly. But its callers in spec/audit.py still have no case with a malformed types value. If one of them goes back to reading entry.get("types", []), every selftest still passes.
Each needs a decision on the intended behavior before it is fixed, so they can land separately.
A seventh gap turned up while reviewing the #1917 fixes:
A tool-config-only pip directory has no profile. Take a directory whose pyproject.toml carries only [tool.*] config and sits beside a requirements*.txt. The validator installs it with pip, and python.uvlock.pinned calls it build. It matches neither shape python.profile.detect defines, and it carries neither a uv.lock nor the project metadata that "a build one must" requires.
mypy on a declared pip directory: respect the repo's config. Skip the injected --python-version when the config pins python_version. Run mypy from .venv when it is installed there, and use uvx otherwise.
Checker config at the root: fall back to the repo-root config when the declared directory has none, and accept setup.cfg[mypy].
unittest discovery: trap exit 5 and print a message naming both causes: pytest-style plain functions, and a nested test directory without __init__.py. Stay stdlib-only.
Name-matched test modules: leave as is. The broad detector is deliberate. A script merely named test_*.py in a lint-only repo is fixed by renaming it.
The audit's caller check: fail loud. A job that uses validate-task.yml under a key other than validate, or a flow-mapping with:, reports a finding that the audit cannot read it, rather than being skipped or misread.
Caller-level selftest cases: add a malformed-types case to each caller's selftest table that lacks one. python_type_findings already has one, so this item was only partly true.
A tool-config-only pip directory: document it as build. Extend python.profile.detect so a directory with requirements*.txt is build, installed with pip, matching what shape() already does.
Activity
Close the Python Gate's Clear-Fix Edge Cases From #1917 (#1937)
Promote develop to main: Close the Python Gate's Clear-Fix Edge Cases (…
ptr727 commentedon Sep 27, 2026
Maintainer decisions, 2026-09-27:
--python-versionwhen the config pinspython_version. Run mypy from.venvwhen it is installed there, and useuvxotherwise.setup.cfg[mypy].__init__.py. Stay stdlib-only.test_*.pyin a lint-only repo is fixed by renaming it.validate-task.ymlunder a key other thanvalidate, or a flow-mappingwith:, reports a finding that the audit cannot read it, rather than being skipped or misread.typescase to each caller's selftest table that lacks one.python_type_findingsalready has one, so this item was only partly true.python.profile.detectso a directory withrequirements*.txtis build, installed with pip, matching whatshape()already does.Settle the Python Gate's Behavior-Changing Edge Cases From #1936 (#1942)
Promote develop to main: Settle the Python Gate's Behavior-Changing E…