Skip to content

Commit 73841d0

Browse files
thewtexhjmjohnson
authored andcommitted
ENH: Add Pixi python-exe and python-exe-debug tasks
Facilitate development and debugging.
1 parent 0967a50 commit 73841d0

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

Documentation/docs/contributing/build_test_itk.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,24 @@ cd src/ITK
5959
pixi run test-python
6060
```
6161

62+
To run a python interpreter with the locally built `itk` Python package:
63+
64+
```shell
65+
pixi run python-exe
66+
```
67+
68+
A Python script can also be passed in, e.g.
69+
70+
```shell
71+
pixi run python-exe ./test.py
72+
```
73+
74+
To run a python interpreter with a locally built `itk` Python package with debug symbols,
75+
76+
```shell
77+
pixi run python-exe-debug
78+
```
79+
6280
### Further testing and development
6381

6482
Additional pixi tasks to run specific steps of the `configure`, `build`, `test` development process or create builds with other [CMake build types] are listed with

pyproject.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,12 @@ cmd = "ctest -j3 --test-dir build-python"
108108
description = "Test ITK Python"
109109
depends-on = ["build-python"]
110110

111+
[tool.pixi.feature.python.tasks.python-exe]
112+
cmd = '''cp ./build-python/Wrapping/Generators/Python/WrapITK.pth $(python -c "import site; print(next(p for p in site.getsitepackages() if \'site-packages\' in p))") &&
113+
python'''
114+
description = "Run a Python executable with the development ITK Python package"
115+
depends-on = ["build-python"]
116+
111117
[tool.pixi.feature.python.tasks.configure-debug-python]
112118
cmd = '''cmake
113119
-Bbuild-debug-python
@@ -130,6 +136,12 @@ cmd = "ctest -j3 --test-dir build-debug-python"
130136
description = "Test ITK Python - Debug"
131137
depends-on = ["build-debug-python"]
132138

139+
[tool.pixi.feature.python.tasks.python-exe-debug]
140+
cmd = '''cp ./build-python/Wrapping/Generators/Python/WrapITK.pth $(python -c "import site; print(next(p for p in site.getsitepackages() if \'site-packages\' in p))") &&
141+
python'''
142+
description = "Run a Python executable with the development ITK Python Debug build package"
143+
depends-on = ["build-debug-python"]
144+
133145
[tool.pixi.environments]
134146
dev = ["dev"]
135147
cxx = ["dev", "cxx"]

0 commit comments

Comments
 (0)