ci: green up modular-viscy-staging (CI matrix, deps, lint)#435
Open
edyoshikun wants to merge 4 commits into
Open
ci: green up modular-viscy-staging (CI matrix, deps, lint)#435edyoshikun wants to merge 4 commits into
edyoshikun wants to merge 4 commits into
Conversation
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.
Contributor
There was a problem hiding this comment.
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-stagingand drop Python 3.11 from the test matrix. - Fix dependency gaps (
viscy-transformsinviscy-datatest group;hydra-coreas a base dep fordynacell) and refreshuv.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 (O → Ov) 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-coreis now a base dependency, but it’s still listed inoptional-dependencies.evalandoptional-dependencies.report. Consider removing it from those extras to avoid redundant declarations and keep the meaning of the extras clear (then regenerateuv.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Restore green CI on
modular-viscy-stagingso PR #373 (the 0.5 merge tomain) can land. Four atomic commits, each fixing one distinct failure class observed on the #373 CI run.What's broken on
modular-viscy-stagingtodayAfter 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):uv syncerrors on Python 3.11requires-python = ">=3.12". CI matrix still includes 3.11 →fail-fast: truecancels every 3.12/3.13 sibling.ModuleNotFoundError: No module named 'viscy_transforms'packages/viscy-data/tests/test_combined.py(+ 2 others) importviscy_transforms, but thetestgroup does not declare it.ModuleNotFoundError: No module named 'hydra'applications/dynacell/src/dynacell/evaluation/pipeline.py:9importshydraunconditionally, buthydra-coreis gated behind theeval/reportextras. CI installs withuv sync --group testonly.FileNotFoundError: /home/eduardo.hirata/.../test_2d_mip_mixed.parquetapplications/dynaclr/scripts/dataloader_inspection/test_2d_mip_augmentation.pyis a Jupyter-style demo (# %%cells, hard-coded/home/eduardo.hirata/...path) named with thetest_prefix, so pytest collects and crashes on it.ruff format,.envrcmissing trailing newline, 1 E741, 3 D100, 1 D102, 1 NPY002.Commits in this PR
ci: drop Python 3.11 from matrix and trigger on modular-viscy-staging—.github/workflows/test.yml,.github/workflows/lint.yml. Removes3.11from the matrix, addsmodular-viscy-stagingto push/pull_request triggers so future PRs targeting the 0.5 staging branch run lint/test.fix(deps): declare viscy-transforms test dep and hydra-core for dynacell— Promoteshydra-core>=1.2to dynacell's basedependencies(it's imported unconditionally), addsviscy-transformstoviscy-data's test group. Regenerateduv.lock.fix(dynaclr): rename test_2d_mip_augmentation.py to demo_; scope pytest to tests/— Renames the demo script todemo_2d_mip_augmentation.py, addstestpaths = ["tests"]under[tool.pytest.ini_options]inapplications/dynaclr/pyproject.tomlso future demo scripts underscripts/are not collected when CI invokes pytest fromapplications/dynaclr/.style: satisfy pre-commit (ruff format, EOF, D100/D102, E741, NPY002)— Auto-fixes fromuvx prek run --all-filesplus the 7 manual lint fixes.Test plan
Test*jobs).