Skip to content

Commit b435dc3

Browse files
authored
Added stubtest in pre-commit config. (#18)
1 parent 464f392 commit b435dc3

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

.pre-commit-config.yaml

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

scripts/bump_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# ruff: noqa
12
import re
23
import argparse
34
from pathlib import Path

scripts/stubtest.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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+
subprocess.run(["maturin", "dev", "--uv"], cwd=ROOT_DIR, check=True)
11+
os.execvpe("stubtest", ["--ignore-disjoint-bases", "natsrpy"], env=os.environ)
12+
13+
14+
if __name__ == "__main__":
15+
main()

0 commit comments

Comments
 (0)