Skip to content

Commit e7d8988

Browse files
committed
Added stubtest in pre-commit config.
1 parent 464f392 commit e7d8988

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,10 @@ repos:
7070
pass_filenames: false
7171
args:
7272
- check
73+
74+
- id: stubtest
75+
name: python stubtest
76+
language: python
77+
entry: python ./scripts/stubtest.py
78+
pass_filenames: false
79+
always_run: true

scripts/stubtest.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# ruff: noqa
2+
import os
3+
import subprocess
4+
from pathlib import Path
5+
6+
ROOT_DIR = Path(__file__).parent.parent
7+
8+
9+
def main():
10+
print(os.environ["VIRTUAL_ENV"])
11+
subprocess.run(["pip", "install", "mypy"], check=True)
12+
subprocess.run(["maturin", "dev", "--uv"], cwd=ROOT_DIR, check=True)
13+
os.execvpe("stubtest", ["--ignore-disjoint-bases", "natsrpy"], env=os.environ)
14+
15+
16+
if __name__ == "__main__":
17+
main()

0 commit comments

Comments
 (0)