Skip to content

ci: green up modular-viscy-staging (CI matrix, deps, lint)#435

Open
edyoshikun wants to merge 4 commits into
modular-viscy-stagingfrom
ci/staging-green-up
Open

ci: green up modular-viscy-staging (CI matrix, deps, lint)#435
edyoshikun wants to merge 4 commits into
modular-viscy-stagingfrom
ci/staging-green-up

Conversation

@edyoshikun
Copy link
Copy Markdown
Member

Summary

Restore green CI on modular-viscy-staging so PR #373 (the 0.5 merge to main) can land. Four atomic commits, each fixing one distinct failure class observed on the #373 CI run.

What's broken on modular-viscy-staging today

After pushing the merge commit to modular-viscy-staging, PR #373 ran CI for the first time and surfaced five pre-existing failure classes (none caused by the merge itself):

Failure Job Root cause
uv sync errors on Python 3.11 Test (3.11 matrix entries) All workspace packages declare requires-python = ">=3.12". CI matrix still includes 3.11 → fail-fast: true cancels every 3.12/3.13 sibling.
ModuleNotFoundError: No module named 'viscy_transforms' Test Data Extras packages/viscy-data/tests/test_combined.py (+ 2 others) import viscy_transforms, but the test group does not declare it.
ModuleNotFoundError: No module named 'hydra' Test dynacell benchmark configs applications/dynacell/src/dynacell/evaluation/pipeline.py:9 imports hydra unconditionally, but hydra-core is gated behind the eval / report extras. CI installs with uv sync --group test only.
FileNotFoundError: /home/eduardo.hirata/.../test_2d_mip_mixed.parquet Test (dynaclr) applications/dynaclr/scripts/dataloader_inspection/test_2d_mip_augmentation.py is a Jupyter-style demo (# %% cells, hard-coded /home/eduardo.hirata/... path) named with the test_ prefix, so pytest collects and crashes on it.
ruff/format/EOF/D/E/NPY violations Lint 5 files needed ruff format, .envrc missing trailing newline, 1 E741, 3 D100, 1 D102, 1 NPY002.

Commits in this PR

  1. ci: drop Python 3.11 from matrix and trigger on modular-viscy-staging.github/workflows/test.yml, .github/workflows/lint.yml. Removes 3.11 from the matrix, adds modular-viscy-staging to push/pull_request triggers so future PRs targeting the 0.5 staging branch run lint/test.
  2. fix(deps): declare viscy-transforms test dep and hydra-core for dynacell — Promotes hydra-core>=1.2 to dynacell's base dependencies (it's imported unconditionally), adds viscy-transforms to viscy-data's test group. Regenerated uv.lock.
  3. fix(dynaclr): rename test_2d_mip_augmentation.py to demo_; scope pytest to tests/ — Renames the demo script to demo_2d_mip_augmentation.py, adds testpaths = ["tests"] under [tool.pytest.ini_options] in applications/dynaclr/pyproject.toml so future demo scripts under scripts/ are not collected when CI invokes pytest from applications/dynaclr/.
  4. style: satisfy pre-commit (ruff format, EOF, D100/D102, E741, NPY002) — Auto-fixes from uvx prek run --all-files plus the 7 manual lint fixes.

Test plan

  • CI on this PR turns green (lint + all Test* jobs).
  • Once merged, re-run CI on PR Staging VisCy Monorepo #373 — should now be CLEAN (no DIRTY conflicts, no red checks blocking merge).

All workspace packages require python>=3.12 but the CI matrix included
3.11, causing uv sync to fail with 'incompatible with the project's
Python requirement: >=3.12' and fail-fast cancelling all other matrix
jobs.

Also extend push/pull_request triggers to modular-viscy-staging so PRs
targeting the 0.5 staging branch run lint/test.
- packages/viscy-data tests import viscy_transforms (test_combined.py,
  test_hcs.py, test_hcs_weighted_crop.py) but it was not declared in the
  test group, causing ModuleNotFoundError in Test Data Extras CI.
- applications/dynacell/src/dynacell/evaluation/pipeline.py:9 imports
  hydra unconditionally. hydra-core was only present in the 'eval' and
  'report' optional extras, so 'uv sync --group test' (used by Test
  dynacell benchmark configs CI) failed at collection with
  ModuleNotFoundError: No module named 'hydra'. Promote hydra-core to a
  base dependency since it's needed at import time.
…st to tests/

The file is a Jupyter-style demo script (# %% cells) with a hardcoded
absolute home path /home/eduardo.hirata/... It is meant to be invoked
via 'uv run python ...', not collected by pytest, but its test_ prefix
caused 'Test (dynaclr)' CI to fail with FileNotFoundError on the missing
parquet at collection time.

- Rename to demo_2d_mip_augmentation.py so pytest does not collect it.
- Add testpaths=['tests'] under [tool.pytest.ini_options] in dynaclr's
  pyproject.toml so future demo scripts under scripts/ are not picked up
  when CI invokes pytest from applications/dynaclr/.
Auto-fixes from prek/pre-commit hooks:
- ruff format: distance.py, lca.py, normalize.py, precompute.py,
  conftest.py (5 files reformatted, no semantic change)
- end-of-file-fixer: append trailing newline to .envrc

Manual fixes:
- E741: rename ambiguous 'O' to 'Ov' (overlap) in celldiff_wrapper.py
  sliding-window patcher.
- D100: add module docstrings to plot_dim_reduct.py, tau_sampling.py,
  channel_dropout.py.
- D102: add forward() docstring in ChannelDropout.
- NPY002: replace np.random.randn() with np.random.default_rng() in
  test_mp_utils.py.

The renamed demo_2d_mip_augmentation.py is in this commit because
ruff format touched its imports as part of the same auto-pass.
@edyoshikun edyoshikun requested review from alxndrkalinin and Copilot and removed request for alxndrkalinin May 23, 2026 00:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores green CI for the modular-viscy-staging branch by aligning the CI Python matrix with the repo’s requires-python>=3.12, fixing missing runtime/test dependencies, preventing pytest from collecting demo scripts, and applying lint/format cleanups.

Changes:

  • Update CI workflows to run on modular-viscy-staging and drop Python 3.11 from the test matrix.
  • Fix dependency gaps (viscy-transforms in viscy-data test group; hydra-core as a base dep for dynacell) and refresh uv.lock.
  • Prevent accidental pytest collection of demo scripts in dynaclr, plus ruff/format and small reproducibility tweaks in tests.

Reviewed changes

Copilot reviewed 16 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
uv.lock Lockfile regeneration reflecting updated dependency declarations.
packages/viscy-utils/tests/test_mp_utils.py Makes the test deterministic via a seeded NumPy Generator API.
packages/viscy-utils/src/viscy_utils/precompute.py Ruff-format cleanup (no functional intent apparent).
packages/viscy-utils/src/viscy_utils/normalize.py Ruff-format cleanup (no functional intent apparent).
packages/viscy-utils/src/viscy_utils/evaluation/lca.py Minor print formatting refactor for reports.
packages/viscy-utils/src/viscy_utils/evaluation/distance.py Ruff-format cleanup (no functional intent apparent).
packages/viscy-data/src/viscy_data/channel_dropout.py Adds module/method docstrings to satisfy docstring linting.
packages/viscy-data/pyproject.toml Adds viscy-transforms to the test dependency group.
applications/qc/tests/conftest.py Ruff-format cleanup in test fixture generation.
applications/dynaclr/src/dynaclr/data/tau_sampling.py Adds module docstring to satisfy linting.
applications/dynaclr/scripts/plotting/plot_dim_reduct.py Adds module docstring to satisfy linting.
applications/dynaclr/scripts/dataloader_inspection/demo_2d_mip_augmentation.py Renames demo script and updates usage text to avoid pytest collection.
applications/dynaclr/pyproject.toml Configures pytest testpaths to scope collection to tests/.
applications/dynacell/src/dynacell/celldiff_wrapper.py Renames ambiguous loop variable (OOv) and minor formatting.
applications/dynacell/pyproject.toml Promotes hydra-core to a base dependency to match unconditional import usage.
.github/workflows/test.yml Drops Python 3.11 from matrix; runs CI for modular-viscy-staging.
.github/workflows/lint.yml Runs lint CI for modular-viscy-staging.
.envrc Adds trailing newline / fixes EOF formatting.
Comments suppressed due to low confidence (1)

applications/dynacell/pyproject.toml:50

  • hydra-core is now a base dependency, but it’s still listed in optional-dependencies.eval and optional-dependencies.report. Consider removing it from those extras to avoid redundant declarations and keep the meaning of the extras clear (then regenerate uv.lock).
dependencies = [
  "hydra-core>=1.2",
  "lightning>=2.3",
  "monai",
  "omegaconf",
  "pydantic>=2",
  "viscy-data[mmap]",
  "viscy-models[celldiff]",
  "viscy-transforms",
  "viscy-utils",
]
optional-dependencies.eval = [
  "accelerate>=1.13",
  "aicsmlsegment",
  "aicssegmentation",
  "cellpose",
  "cubic==0.7.0a2",
  "dynaclr",
  "hydra-core>=1.2",
  "iohub",

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants