Fix itk_infer command#78
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the package metadata to fix the published itk_infer console script so it points to an existing module, and bumps the project version accordingly.
Changes:
- Bump project version from
4.0.0rc4to4.0.0rc5. - Update the
itk_inferentry point toitkit.process.itk_infer:main.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| itkit-app = "itkit.gui.app:main" | ||
| itk_slicer = "SlicerITKIT.server.itkit_server:main" | ||
| itk_infer = "itkit.inference.itk_infer:main" | ||
| itk_infer = "itkit.process.itk_infer:main" |
There was a problem hiding this comment.
itk_infer now points to itkit.process.itk_infer:main, but that module imports zarr at import time (see itkit/process/itk_infer.py:12) while zarr is not listed in [project].dependencies or any optional extra. This will make the itk_infer command fail with ModuleNotFoundError for users who install the base package. Add zarr as an install dependency (or an extra that is clearly required for itk_infer) and/or change itk_infer to import zarr lazily only when --save-logits is used and emit a clear error if missing.
| itkit-app = "itkit.gui.app:main" | ||
| itk_slicer = "SlicerITKIT.server.itkit_server:main" | ||
| itk_infer = "itkit.inference.itk_infer:main" | ||
| itk_infer = "itkit.process.itk_infer:main" |
There was a problem hiding this comment.
There is comprehensive pytest coverage for other itkit.process.* CLI entry points (e.g., tests/itk_process/test_process_mains.py), but no test exercises the itk_infer entry point/module import. Since this PR changes the published script target, add at least a lightweight test that imports itkit.process.itk_infer and verifies main is reachable (skipping when optional deps like torch/zarr aren’t installed) to prevent regressions in the command wiring.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #78 +/- ##
=======================================
Coverage ? 72.19%
=======================================
Files ? 108
Lines ? 12239
Branches ? 1097
=======================================
Hits ? 8836
Misses ? 3147
Partials ? 256 ☔ View full report in Codecov by Sentry. |
No description provided.