Skip to content

Add uv lock + bump MONAI lower bound #123

Draft
C-Achard wants to merge 15 commits into
mainfrom
cy/py312-uv-lock
Draft

Add uv lock + bump MONAI lower bound #123
C-Achard wants to merge 15 commits into
mainfrom
cy/py312-uv-lock

Conversation

@C-Achard
Copy link
Copy Markdown
Collaborator

  • Adds uv lock to provide known good env and help installation
  • Bump MONAI lower bound to 1.3.2

C-Achard and others added 15 commits May 19, 2026 14:25
Remove legacy packaging and test config files (setup.cfg, requirements.txt, .isort.cfg, napari_cellseg3d/_tests/pytest.ini, and its conftest). Migrate and update metadata in pyproject.toml: bump supported Python classifiers to 3.10–3.12, add napari manifest entry-point, include napari.yaml in package data, simplify dynamic fields, adjust optional dependencies (add PyQt6, pyside6, move pydensecrf2 to crf extra) and streamline dev dependencies (remove black/isort as direct dev deps). Update tooling rules (ruff token change) and remove redundant tool configs. Update tox.ini to target py310/311/312 across linux/windows/macos, expose platform mappings for GH Actions, and switch to using extras for test/crf/pyqt6 while keeping usedevelop and running pytest as the test command.
Skip a test that causes GitHub Actions to freeze by importing pytest and marking it skipped (needs to be fixed or removed). In worker_inference, replace np.reshape(...) with the ndarray.reshape(...) call and remove an obsolete commented reshape for clarity. In dev_scripts/correct_labels, initialize a napari.Viewer and add the image via viewer.add_image instead of calling napari.view_image(), ensuring the image layer is properly created.
* Enhance GitHub Actions CI and deploy workflow

Modernize and expand the test-and-deploy workflow: bump action versions (checkout/setup-python), enable pip caching, and broaden the matrix to ubuntu, windows, and macos with Python 3.10–3.12. Add fail-fast:false and platform-specific steps (Linux Qt libs, Windows OpenGL with pwsh). Install tox centrally and run tests per-OS with appropriate Qt/PyQt and PyVista env vars; upload coverage with codecov v6. Adjust deploy job to trigger on semver-style tags (refs/tags/v*), update setup actions, split build and publish steps (build then twine upload), and simplify dependency installs.

* Fix missing OSs in tox.ini
Enable setuptools_scm-based versioning and tighten CI/build checks. Updates include:

- Use setuptools_scm: add setuptools-scm to build-system requires and configure version_file in pyproject.toml so package version is generated into napari_cellseg3d/_version.py.
- Make package import version dynamically: __init__.py now prefers the generated _version and falls back to importlib.metadata.version.
- Bump minimum Python to >=3.10 in pyproject.
- CI/workflow changes: fetch full Git history (fetch-depth: 0), restrict Codecov upload to ubuntu-latest + Python 3.12, pin the build job to Python 3.12, and add a twine check step before publishing.
- Minor dev script cleanup: remove unused assignment when adding image to napari viewer.

These changes improve reproducible versioning, ensure the build uses an appropriate Python/tooling set, and add a safety check before publishing.
Use the generic CI environment variable when skipping the weight download test (os.getenv("CI") instead of "GITHUB_ACTIONS") and update the skip reason to mention CI. Also add a small formatting tweak (blank line after import) and adjust file ending.
Expand unit test coverage for napari_cellseg3d.code_plugins.plugin_base. Rename a test for updating default paths and add many new tests covering: results path creation/validation, _build not implemented, navigation buttons, dock widget removal (including LookupError handling), dataset path extraction, folder plugin default path updates, dataset loading (images, labels, unsupervised), dataset load warnings, file/folder dialog integrations (filetype and path updates), and visibility helpers. Also add necessary imports and use plugin_base for monkeypatching ui/utils/logger behaviors.
Add Windows-specific environment variables to tox.ini passenv: set USERNAME to 'runneradmin' and TORCHINDUCTOR_CACHE_DIR to {envtmpdir}/torchinductor. Ensures Windows test runs use a consistent username and place TorchInductor cache in the temporary directory.
Update test_make_navigation_buttons to use real QWidget instances and the qtbot fixture instead of SimpleNamespace. The test now accepts qtbot, creates two QWidgets, registers them with qtbot.addWidget, and adds them as tabs before checking navigation buttons—ensuring proper Qt widget management and avoiding teardown/warning issues.
Insert the missing `setenv` key in tox.ini so the Windows-specific environment variables (USERNAME, TORCHINDUCTOR_CACHE_DIR) are declared under the correct section. This fixes configuration formatting and ensures those variables are applied in tox runs on Windows.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This reverts commit 89921c7.
Update test_relabel to use the make_napari_viewer_proxy fixture: create a viewer instance and pass it to cl.relabel via viewer=viewer. This ensures the relabel test runs with a proxied Napari viewer (e.g. for headless/test environments) and verifies behavior when a viewer is provided.
@C-Achard C-Achard self-assigned this May 19, 2026
@C-Achard C-Achard added enhancement New feature or request requirements Related to installation requirements and optional dependencies labels May 19, 2026
@C-Achard C-Achard added this to the Python 3.10-3.12 support milestone May 19, 2026
@C-Achard C-Achard changed the base branch from cy/py-312-support to main May 19, 2026 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request requirements Related to installation requirements and optional dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant