Skip to content

fix: remove outdated ninja_syntax stub - #365

Merged
henryiii merged 1 commit into
masterfrom
fix/ninja-syntax-stub
Sep 1, 2026
Merged

henryiii merged 1 commit into
masterfrom
fix/ninja-syntax-stub

Conversation

@henryiii

@henryiii henryiii commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

src/ninja/ninja_syntax.pyi did not match the ninja_syntax.py module that the build installs: output was str instead of a file object, build() accepted only list[str] outputs, and build() had no return type.

Upstream annotates ninja_syntax.py, and the package includes py.typed. The stub is removed, so type checkers use the upstream annotations and the types cannot drift again.

A test makes sure that no stub shadows the module and that the module keeps its annotations. mypy gets an override, because ninja_syntax.py is only present after a build.

Closes #344

The stub did not match the shipped ninja_syntax.py: it typed `output` as
`str`, `build()` outputs as `list[str]` only, and gave `build()` no return
type. Upstream annotates ninja_syntax.py, and the package has py.typed, so
type checkers can use the real annotations and cannot drift again.

Closes #344

Assisted-by: ClaudeCode:claude-opus-5
@henryiii
henryiii merged commit 0288ae7 into master Sep 1, 2026
21 checks passed
@henryiii
henryiii deleted the fix/ninja-syntax-stub branch September 1, 2026 15:15
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.

ninja_syntax.pyi stub does not match ninja's writer module

1 participant