From 8000bc8e8e3223ddad1e5c32b01be42a8889be39 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Thu, 8 Oct 2026 16:57:12 -0400 Subject: [PATCH] Run the type check in checks and omit integration tests by glob Every variant's checks target runs check-types, and the compiled modules get .pyi stubs so ty resolves them. The coverage omit for integration tests is a glob; a bare directory path matches no file. Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- python/cpp/Makefile.jinja | 2 +- python/cpp/pyproject.toml.jinja | 2 +- python/cpp/{{module}}/extension.pyi | 1 + python/cppjswasm/Makefile.jinja | 2 +- python/cppjswasm/pyproject.toml.jinja | 2 +- python/cppjswasm/{{module}}/extension_cpp.pyi | 1 + python/cython/Makefile.jinja | 2 +- python/cython/pyproject.toml.jinja | 2 +- python/cython/{{module}}/_native.pyi | 1 + python/js/Makefile.jinja | 2 +- python/js/pyproject.toml.jinja | 2 +- python/jupyter/Makefile.jinja | 2 +- python/jupyter/pyproject.toml.jinja | 2 +- python/pure/Makefile.jinja | 2 +- python/pure/pyproject.toml.jinja | 2 +- python/rust/Makefile.jinja | 2 +- python/rust/pyproject.toml.jinja | 2 +- python/rustjswasm/Makefile.jinja | 2 +- python/rustjswasm/pyproject.toml.jinja | 2 +- 19 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 python/cpp/{{module}}/extension.pyi create mode 100644 python/cppjswasm/{{module}}/extension_cpp.pyi create mode 100644 python/cython/{{module}}/_native.pyi diff --git a/python/cpp/Makefile.jinja b/python/cpp/Makefile.jinja index b515de31..42df121f 100644 --- a/python/cpp/Makefile.jinja +++ b/python/cpp/Makefile.jinja @@ -66,7 +66,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # alias check: checks diff --git a/python/cpp/pyproject.toml.jinja b/python/cpp/pyproject.toml.jinja index 3826a534..9110ffb7 100644 --- a/python/cpp/pyproject.toml.jinja +++ b/python/cpp/pyproject.toml.jinja @@ -110,7 +110,7 @@ test-requires = ["pytest"] [tool.coverage.run] branch = true omit = [ - "{{ module }}/tests/integration/", + "{{ module }}/tests/integration/*", ] [tool.coverage.report] diff --git a/python/cpp/{{module}}/extension.pyi b/python/cpp/{{module}}/extension.pyi new file mode 100644 index 00000000..bfb558de --- /dev/null +++ b/python/cpp/{{module}}/extension.pyi @@ -0,0 +1 @@ +def add(i: int, j: int) -> int: ... diff --git a/python/cppjswasm/Makefile.jinja b/python/cppjswasm/Makefile.jinja index e243c043..957d88c3 100644 --- a/python/cppjswasm/Makefile.jinja +++ b/python/cppjswasm/Makefile.jinja @@ -97,7 +97,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # alias check: checks diff --git a/python/cppjswasm/pyproject.toml.jinja b/python/cppjswasm/pyproject.toml.jinja index 64253329..3fd6b904 100644 --- a/python/cppjswasm/pyproject.toml.jinja +++ b/python/cppjswasm/pyproject.toml.jinja @@ -122,7 +122,7 @@ test-requires = ["pytest"] [tool.coverage.run] branch = true omit = [ - "{{ module }}/tests/integration/", + "{{ module }}/tests/integration/*", ] [tool.coverage.report] diff --git a/python/cppjswasm/{{module}}/extension_cpp.pyi b/python/cppjswasm/{{module}}/extension_cpp.pyi new file mode 100644 index 00000000..bfb558de --- /dev/null +++ b/python/cppjswasm/{{module}}/extension_cpp.pyi @@ -0,0 +1 @@ +def add(i: int, j: int) -> int: ... diff --git a/python/cython/Makefile.jinja b/python/cython/Makefile.jinja index 1842e9e1..c1b271a3 100644 --- a/python/cython/Makefile.jinja +++ b/python/cython/Makefile.jinja @@ -40,7 +40,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check Python types (advisory) ty check {{ module }} -checks: check-dist ## run distribution checks +checks: check-dist check-types ## run distribution checks check: checks test: ## run Python tests diff --git a/python/cython/pyproject.toml.jinja b/python/cython/pyproject.toml.jinja index 9d6043a2..8e6ef07d 100644 --- a/python/cython/pyproject.toml.jinja +++ b/python/cython/pyproject.toml.jinja @@ -87,7 +87,7 @@ replace = 'version = "{new_version}"' [tool.coverage.run] branch = true omit = [ - "{{ module }}/tests/integration/", + "{{ module }}/tests/integration/*", "{{ module }}/_compiled.py", ] diff --git a/python/cython/{{module}}/_native.pyi b/python/cython/{{module}}/_native.pyi new file mode 100644 index 00000000..44df0f35 --- /dev/null +++ b/python/cython/{{module}}/_native.pyi @@ -0,0 +1 @@ +def add(left: int, right: int) -> int: ... diff --git a/python/js/Makefile.jinja b/python/js/Makefile.jinja index b478d930..00618919 100644 --- a/python/js/Makefile.jinja +++ b/python/js/Makefile.jinja @@ -79,7 +79,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # alias check: checks diff --git a/python/js/pyproject.toml.jinja b/python/js/pyproject.toml.jinja index c187e98c..2dfb4402 100644 --- a/python/js/pyproject.toml.jinja +++ b/python/js/pyproject.toml.jinja @@ -92,7 +92,7 @@ replace = '"version": "{new_version}"' [tool.coverage.run] branch = true omit = [ - "{{ module }}/tests/integration/", + "{{ module }}/tests/integration/*", ] [tool.coverage.report] diff --git a/python/jupyter/Makefile.jinja b/python/jupyter/Makefile.jinja index ef081c76..6710fc9b 100644 --- a/python/jupyter/Makefile.jinja +++ b/python/jupyter/Makefile.jinja @@ -81,7 +81,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # alias check: checks diff --git a/python/jupyter/pyproject.toml.jinja b/python/jupyter/pyproject.toml.jinja index 2545f307..98d2f4e7 100644 --- a/python/jupyter/pyproject.toml.jinja +++ b/python/jupyter/pyproject.toml.jinja @@ -100,7 +100,7 @@ replace = '"version": "{new_version}"' [tool.coverage.run] branch = true omit = [ - "{{ module }}/tests/integration/", + "{{ module }}/tests/integration/*", ] [tool.coverage.report] diff --git a/python/pure/Makefile.jinja b/python/pure/Makefile.jinja index 1708a806..88408839 100644 --- a/python/pure/Makefile.jinja +++ b/python/pure/Makefile.jinja @@ -52,7 +52,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # Alias check: checks diff --git a/python/pure/pyproject.toml.jinja b/python/pure/pyproject.toml.jinja index 9c992d57..83d5f958 100644 --- a/python/pure/pyproject.toml.jinja +++ b/python/pure/pyproject.toml.jinja @@ -81,7 +81,7 @@ replace = 'version = "{new_version}"' [tool.coverage.run] branch = true omit = [ - "{{ module }}/tests/integration/", + "{{ module }}/tests/integration/*", ] [tool.coverage.report] diff --git a/python/rust/Makefile.jinja b/python/rust/Makefile.jinja index c7913201..addd238f 100644 --- a/python/rust/Makefile.jinja +++ b/python/rust/Makefile.jinja @@ -80,7 +80,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # alias check: checks diff --git a/python/rust/pyproject.toml.jinja b/python/rust/pyproject.toml.jinja index 5a831442..a898e122 100644 --- a/python/rust/pyproject.toml.jinja +++ b/python/rust/pyproject.toml.jinja @@ -131,7 +131,7 @@ xbuild-tools = ["cargo", "rustc", "rustup"] [tool.coverage.run] branch = true omit = [ - "{{ module }}/tests/integration/", + "{{ module }}/tests/integration/*", ] [tool.coverage.report] diff --git a/python/rustjswasm/Makefile.jinja b/python/rustjswasm/Makefile.jinja index 88d51f35..11dd019e 100644 --- a/python/rustjswasm/Makefile.jinja +++ b/python/rustjswasm/Makefile.jinja @@ -94,7 +94,7 @@ check-dist: ## check python sdist and wheel with check-dist check-types: ## check python types with ty ty check --python $$(which python) -checks: check-dist +checks: check-dist check-types # alias check: checks diff --git a/python/rustjswasm/pyproject.toml.jinja b/python/rustjswasm/pyproject.toml.jinja index 5413f5fe..a600bc1c 100644 --- a/python/rustjswasm/pyproject.toml.jinja +++ b/python/rustjswasm/pyproject.toml.jinja @@ -143,7 +143,7 @@ xbuild-tools = ["cargo", "rustc", "rustup"] [tool.coverage.run] branch = true omit = [ - "{{ module }}/tests/integration/", + "{{ module }}/tests/integration/*", ] [tool.coverage.report]