Skip to content

Commit 32958e6

Browse files
authored
Merge pull request #209 from python-project-templates/tkp/rust-extension-type-stubs
Fix Rust extension types and simplify type checks
2 parents 162463c + b996f08 commit 32958e6

10 files changed

Lines changed: 17 additions & 7 deletions

File tree

‎.github/workflows/build.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,12 @@ jobs:
123123
- name: Test template
124124
run: make test-${{ matrix.template }}
125125

126+
- name: Check types with Pyodide enabled
127+
run: |
128+
copier copy --defaults --vcs-ref=$(git rev-parse HEAD) . ../python-template-${{ matrix.template }}-pyodide --data-file examples/${{ matrix.template }}.yaml --data add_pyodide=true
129+
make -C ../python-template-${{ matrix.template }}-pyodide check-types
130+
if: matrix.template == 'rust' || matrix.template == 'rustjswasm'
131+
126132
- name: Check source distribution artifacts
127133
run: python .github/scripts/check_sdist_artifacts.py ../python-template-${{ matrix.template }}
128134
env:

‎python/cpp/Makefile.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ check-dist: ## check python sdist and wheel with check-dist
6464
check-dist -v
6565

6666
check-types: ## check python types with ty
67-
ty check --python $$(which python)
67+
python -m ty check
6868

6969
checks: check-dist check-types
7070

‎python/cppjswasm/Makefile.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ check-dist: ## check python sdist and wheel with check-dist
9595
check-dist -v
9696

9797
check-types: ## check python types with ty
98-
ty check --python $$(which python)
98+
python -m ty check
9999

100100
checks: check-dist check-types
101101

‎python/js/Makefile.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ check-dist: ## check python sdist and wheel with check-dist
7777
check-dist -v
7878

7979
check-types: ## check python types with ty
80-
ty check --python $$(which python)
80+
python -m ty check
8181

8282
checks: check-dist check-types
8383

‎python/jupyter/Makefile.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ check-dist: ## check python sdist and wheel with check-dist
7979
check-dist -v
8080

8181
check-types: ## check python types with ty
82-
ty check --python $$(which python)
82+
python -m ty check
8383

8484
checks: check-dist check-types
8585

‎python/pure/Makefile.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ check-dist: ## check python sdist and wheel with check-dist
5050
check-dist -v
5151

5252
check-types: ## check python types with ty
53-
ty check --python $$(which python)
53+
python -m ty check
5454

5555
checks: check-dist check-types
5656

‎python/rust/Makefile.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ check-dist: ## check python sdist and wheel with check-dist
7878
check-dist -v
7979

8080
check-types: ## check python types with ty
81-
ty check --python $$(which python)
81+
python -m ty check
8282

8383
checks: check-dist check-types
8484

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Example:
2+
def __init__(self, value: str) -> None: ...

‎python/rustjswasm/Makefile.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ check-dist: ## check python sdist and wheel with check-dist
9292
check-dist -v
9393

9494
check-types: ## check python types with ty
95-
ty check --python $$(which python)
95+
python -m ty check
9696

9797
checks: check-dist check-types
9898

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
class Example:
2+
def __init__(self, value: str) -> None: ...

0 commit comments

Comments
 (0)