Hello, I’m working on the CudaCommon remote module and need an efficient way to test Python packages from generated wheels in our CI pipeline. Current options have limitations:
The first approach with itk_python_add_test
Add Python tests using itk_python_add_test in the module’s CMakeLists.txt
These tests run via CTest with a specific label: ctest -L Python.
Key issue: This requires building ITK with Python wrapping enabled (-DITK_WRAP_PYTHON=ON), which is time-consuming.
Add a python-test flag in CudaCommon , which simplify the configuration (I just have to configure CudaCommon with the flag enabled, see my PR), but I would like to avoid creating new flags.
Has anyone developed an efficient workflow for testing Python-wrapped modules without rebuilding ITK each time? What approach do you recommend?
Thanks for your quick answer. If I understand correctly, ITK uses Python tests declared with itk_python_add_test, run by the CI e.g. in AzurePipelinesLinuxPython.yml but you would not recommend using this for testing the Python code of remote modules but to prefer instead using pytest?
Are the wrappers we generate during development working correctly?
Are the packages we generate working correctly from an installation?
For the former, yes, itk_python_add_test makes CI and development possible. For the latter, testing after installation is desirable. It should be possible to use the same testing for both itk_python_add_test and pytest by naming the test files test_*.