From a9418999ac4a0d3f563512d4312042b7081a900f Mon Sep 17 00:00:00 2001 From: rawsun007 Date: Tue, 15 Sep 2026 09:33:04 +0530 Subject: [PATCH] Make build.sh stubtest run again disallow_any_explicit applied to every module the stub pulls in, not just the stub under test. Once pygit2/_libgit2/ffi.pyi arrived in 58d12711, that aborted the run with 25 errors in files stubtest never reads. Nothing in CI runs this command, so it went unnoticed. The setting is now scoped: off for the package, on for pygit2._pygit2. stubtest reports no issues with the stub as it stands. Assisted-by: Claude Opus 5 (Claude Code) --- mypy-stubtest.ini | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mypy-stubtest.ini b/mypy-stubtest.ini index a8022cbc0..6f026654e 100644 --- a/mypy-stubtest.ini +++ b/mypy-stubtest.ini @@ -14,3 +14,15 @@ disallow_any_explicit = True # don't follow import pygit2 from _pygit2.pyi, we only want to check the pyi file. [mypy-pygit2] follow_imports = skip + +# The stub imports names from the package (pygit2.Index) and from the cffi +# binding stub, so those modules enter the build even though stubtest only +# reads _pygit2.pyi. disallow_any_explicit above is about the stub under test; +# applying it to the rest of the package is what stopped stubtest running at +# all once pygit2/_libgit2/ffi.pyi arrived. +[mypy-pygit2.*] +disallow_any_explicit = False + +# ... except the stub under test, which is the point of the setting. +[mypy-pygit2._pygit2] +disallow_any_explicit = True