Skip to content

Commit ca09db7

Browse files
update tasks with new run_with_env script
1 parent cb776ab commit ca09db7

2 files changed

Lines changed: 49 additions & 19 deletions

File tree

.vscode/tasks.json

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{
1+
{
22
// See https://go.microsoft.com/fwlink/?LinkId=733558
33
// for the documentation about the tasks.json format
44
"version": "2.0.0",
@@ -180,13 +180,13 @@
180180
"label": "📊 Coverage full",
181181
"type": "shell",
182182
"windows": {
183-
"command": "${command:python.interpreterPath} -m coverage combine; if ($?) { ${command:python.interpreterPath} -m coverage html; if ($?) { start htmlcov\\index.html } }",
183+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage combine; if ($?) { ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage html; if ($?) { start htmlcov\\index.html } }",
184184
},
185185
"linux": {
186-
"command": "${command:python.interpreterPath} -m coverage combine && ${command:python.interpreterPath} -m coverage html && xdg-open htmlcov/index.html",
186+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage combine && ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage html && xdg-open htmlcov/index.html",
187187
},
188188
"osx": {
189-
"command": "${command:python.interpreterPath} -m coverage combine && ${command:python.interpreterPath} -m coverage html && open htmlcov/index.html",
189+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage combine && ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m coverage html && open htmlcov/index.html",
190190
},
191191
"options": {
192192
"cwd": "${workspaceFolder}",
@@ -255,18 +255,21 @@
255255
{
256256
"label": "Build documentation",
257257
"type": "shell",
258-
"command": "cmd",
258+
"windows": {
259+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m sphinx -b html doc build/doc; if ($?) { start build\\doc\\index.html }"
260+
},
261+
"linux": {
262+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m sphinx -b html doc build/doc && xdg-open build/doc/index.html"
263+
},
264+
"osx": {
265+
"command": "${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m sphinx -b html doc build/doc && open build/doc/index.html"
266+
},
259267
"options": {
260-
"cwd": "scripts",
268+
"cwd": "${workspaceFolder}",
261269
"env": {
262-
"PYTHON": "${command:python.interpreterPath}",
263270
"UNATTENDED": "1"
264271
}
265272
},
266-
"args": [
267-
"/c",
268-
"build_doc.bat"
269-
],
270273
"problemMatcher": [],
271274
"group": {
272275
"kind": "build",
@@ -284,18 +287,21 @@
284287
{
285288
"label": "Build Python packages",
286289
"type": "shell",
287-
"command": "cmd",
290+
"windows": {
291+
"command": "if (Test-Path MANIFEST) { Remove-Item MANIFEST }; ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m build; if (Test-Path PythonQwt.egg-info) { Remove-Item -Recurse -Force PythonQwt.egg-info }"
292+
},
293+
"linux": {
294+
"command": "rm -f MANIFEST && ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m build && rm -rf PythonQwt.egg-info"
295+
},
296+
"osx": {
297+
"command": "rm -f MANIFEST && ${command:python.interpreterPath} scripts/run_with_env.py ${command:python.interpreterPath} -m build && rm -rf PythonQwt.egg-info"
298+
},
288299
"options": {
289-
"cwd": "scripts",
300+
"cwd": "${workspaceFolder}",
290301
"env": {
291-
"PYTHON": "${command:python.interpreterPath}",
292302
"UNATTENDED": "1"
293303
}
294304
},
295-
"args": [
296-
"/c",
297-
"build_dist.bat"
298-
],
299305
"problemMatcher": [],
300306
"group": {
301307
"kind": "build",
@@ -344,4 +350,4 @@
344350
},
345351
},
346352
]
347-
}
353+
}

scripts/take_screenshots.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2026 PlotPyStack developers
2+
# Licensed under the terms of the MIT License
3+
# (see LICENSE file for more details)
4+
5+
"""Screenshots update script."""
6+
7+
import subprocess
8+
import sys
9+
10+
11+
def main():
12+
"""Run all screenshot-generating scripts."""
13+
scripts = [
14+
[sys.executable, "qwt/tests/__init__.py", "--mode", "screenshots"],
15+
[sys.executable, "doc/plot_example.py"],
16+
[sys.executable, "doc/symbol_path_example.py"],
17+
]
18+
for cmd in scripts:
19+
print(f"Running: {' '.join(cmd)}")
20+
subprocess.check_call(cmd)
21+
22+
23+
if __name__ == "__main__":
24+
main()

0 commit comments

Comments
 (0)