Skip to content

Commit 8fea2ac

Browse files
authored
πŸ§‘β€πŸ’» vscode tasks for basedpyright, mypy, and stubtest (#754)
2 parents c8fe880 + 23592fb commit 8fea2ac

File tree

3 files changed

+81
-12
lines changed

3 files changed

+81
-12
lines changed

β€Ž.github/workflows/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ jobs:
9494
uv run
9595
-p ${{ matrix.python }}
9696
--with="numpy==${{ matrix.numpy }}"
97-
--active
9897
--no-editable
9998
basedpyright
10099
@@ -103,7 +102,6 @@ jobs:
103102
uv run
104103
-p ${{ matrix.python }}
105104
--with="numpy==${{ matrix.numpy }}"
106-
--active
107105
--no-editable
108106
mypy
109107
--tb
@@ -119,9 +117,7 @@ jobs:
119117
uv run
120118
-p ${{ matrix.python }}
121119
--with="numpy==${{ matrix.numpy }}"
122-
--active
123120
--no-editable
124121
stubtest
125122
--allowlist=.mypyignore
126-
--mypy-config-file=pyproject.toml
127123
scipy

β€Ž.vscode/tasks.json

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [{
4+
"label": "basedpyright",
5+
"type": "shell",
6+
"command": "uv",
7+
"args": ["run", "basedpyright"],
8+
"group": {
9+
"kind": "build",
10+
"isDefault": false
11+
},
12+
"presentation": {
13+
"clear": true
14+
},
15+
"problemMatcher": [{
16+
"owner": "basedpyright",
17+
"fileLocation": "absolute",
18+
"pattern": {
19+
"regexp": "^(.+):(\\d+):(\\d+) - (error|warning|info): (.+)$",
20+
"file": 1,
21+
"line": 2,
22+
"column": 3,
23+
"severity": 4,
24+
"message": 5
25+
}
26+
}],
27+
"options": {
28+
"cwd": "${workspaceFolder}"
29+
}
30+
}, {
31+
"label": "mypy",
32+
"type": "shell",
33+
"command": "uv",
34+
"args": ["run", "--no-editable", "mypy", "."],
35+
"group": {
36+
"kind": "build",
37+
"isDefault": false
38+
},
39+
"presentation": {
40+
"clear": true
41+
},
42+
"problemMatcher": [{
43+
"owner": "mypy",
44+
"fileLocation": "absolute",
45+
"pattern": {
46+
"regexp": "^(.+):(\\d+): (error|warning|note): (.+)$",
47+
"file": 1,
48+
"line": 2,
49+
"severity": 3,
50+
"message": 4
51+
}
52+
}],
53+
"options": {
54+
"cwd": "${workspaceFolder}"
55+
}
56+
}, {
57+
"label": "stubtest",
58+
"type": "shell",
59+
"command": "uv",
60+
"args": [
61+
"run",
62+
"--no-editable",
63+
"--reinstall-package=scipy-stubs",
64+
"stubtest",
65+
"--allowlist=.mypyignore",
66+
"scipy"
67+
],
68+
"group": {
69+
"kind": "build",
70+
"isDefault": false
71+
},
72+
"presentation": {
73+
"clear": true
74+
},
75+
"options": {
76+
"cwd": "${workspaceFolder}"
77+
}
78+
}]
79+
}

β€Žpyproject.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,8 @@ rm -rf
8787

8888
[tool.poe.tasks.stubtest]
8989
cmd = """
90-
uv run
91-
--no-editable
92-
--reinstall-package=scipy-stubs
93-
stubtest
94-
--allowlist=.mypyignore
95-
--mypy-config-file=pyproject.toml
96-
$modules
90+
uv run --no-editable --reinstall-package=scipy-stubs
91+
stubtest --allowlist=.mypyignore $modules
9792
"""
9893
args = [{ name = "modules", positional = true, multiple = true, default = "scipy" }]
9994

@@ -229,7 +224,6 @@ commands = [
229224
[
230225
"stubtest",
231226
"--allowlist=.mypyignore",
232-
"--mypy-config-file=pyproject.toml",
233227
{ replace = "posargs", default = ["scipy"], extend = true },
234228
],
235229
]

0 commit comments

Comments
Β (0)