Repository navigation
Update template to v0.8.0 - #137
Closed
scverse-bot wants to merge 2 commits into
Closed
scverse-bot wants to merge 2 commits into
scverse-bot wants to merge 2 commits into
Conversation
Collaborator
|
Closed in favor of #140 |
moinfar
added a commit
that referenced
this pull request
Sep 17, 2026
* Update template to v0.8.0 Applies the cookiecutter-scverse v0.8.0 template update (#137) via `cruft update`, resolving conflicts by hand since the automated PR was based on the pristine template baseline instead of current main. - Pin GitHub Actions to immutable commit hashes and add zizmor as a pre-commit hook to harden CI against supply-chain attacks - Migrate from pre-commit to prek, and add mypy type checking (with overrides for currently-untyped third-party deps and pre-existing type errors, to be cleaned up incrementally) - Migrate docs from sphinx-tabs to sphinx-design and move shared sphinx extensions into scverse-misc - Add an autofix.ci workflow, list installed packages in test CI output, and other minor CI/docs housekeeping from the template release Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Fix all mypy errors instead of suppressing them Removes the blanket ignore_errors overrides added when wiring up mypy from the template and actually resolves the 15 real type errors they were masking, across _cmap, _generative_mixin, _module, _metrics, _interpretability, _latent, and porting. Only the ignore_missing_imports override for untyped third-party deps (scanpy/scipy/scvi/sklearn) remains. Notable fixes: - _cmap.py: give each colormap dict its own name and a Literal-keyed type instead of reusing one dynamically-retyped `cmap_data` variable - _generative_mixin.py: declare the attributes SparseLatentMixin expects from the model classes it's combined with, under TYPE_CHECKING - _metrics.py: annotate torchmetrics state/buffer attributes so they're seen as Tensor rather than the generic Module fallback - _latent.py: add an _as_frame() helper to narrow anndata's `DataFrame | Dataset2D` to a concrete DataFrame, since this module's operations (groupby/query/sort_values/mutation) require an in-memory AnnData anyway Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> * Use cast-based narrowing for the mypy fixes Reworks the previous commit's type fixes to be less intrusive and more honest about what is actually known: - _latent.py: `_as_df`/`_as_array` now narrow anndata's `.obs`/`.var`/`.X` annotations with `typing.cast` instead of an isinstance check that raised. The raise added an untested error path (and a repeated name string at every call site) for a change that is only about types. - _generative_mixin.py: declare the attributes the mixin expects from its sibling base class as `Callable`, rather than fabricating full signatures for an upstream (untyped) scvi API that mypy cannot verify them against. - _cmap.py: keep the per-colormap data dicts private; `plotting.cmap` is a public module, so they should not become API. - _interpretability.py: lift `_dim_number` out of the plotting function body and raise `ValueError` rather than assert. - porting.py: express the terminal chain entry as `if migration := ...` (None means "no parameter change"), which the dict already means, instead of asserting it away. - Drop the two `# type: ignore` comments and the bare asserts these replace. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Add changelog entries for the template sync Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Skip the mypy hook on pre-commit.ci The hook shells out to `hatch`, which pre-commit.ci cannot provide: mypy needs the project's dependencies installed, and pre-commit.ci has no network access while running hooks. It failed there with "Executable `hatch` not found" while every other hook passed. mypy still runs locally through prek and on CI in the `Pre-commit checks` job, which installs hatch first. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.
cookiecutter-scversereleased v0.8.0.Changes
This release comes with a bunch of smaller fixes and changes to the template, and a lot of under-the-hood changes reducing friction with template sync and initialization.
Changes
The most notable change is the introduction of zizmor as pre-commit hook for hardening github actions against supply-chain attacks. Github actions will be pinned to an immutable hash instead of a version number. Dependabot will take care of updating them (by
@ilan-gold,@grst,@ilia-katsin scverse/cookiecutter-scverse#498).Additionally, we introduced a helper package, scverse-misc, that contains utility code shared across scverse core and ecosystem packages. As an initial step, we moved custom sphinx extensions that were previously part of the template into scverse-misc (by
@ilia-katsin scverse/cookiecutter-scverse#529). Rollout of additional features (shared logging and settings) will follow in the next release.The remaining changes are listed below:
Updates to the template
@flying-sheepin ci: remove hacks for docs building scverse/cookiecutter-scverse#462@grstin List all installed packages in CI output scverse/cookiecutter-scverse#469@timtreisin ci: bump codecov-action to v6 to fix signature verification scverse/cookiecutter-scverse#510@flying-sheepin feat: remove __version__ cargo cult scverse/cookiecutter-scverse#495@grstin Update instructions on hatch/VScode integration scverse/cookiecutter-scverse#525@flying-sheepin docs: sphinx 9 compatibility, sphinx-tabs→sphinx-design scverse/cookiecutter-scverse#467@ilia-katsin README: use the official readthedocs badge scverse/cookiecutter-scverse#513@flying-sheepin docs: robust links scverse/cookiecutter-scverse#514@ilia-katsin support prek in addition to pre-commit scverse/cookiecutter-scverse#485 and by@grstin Recommend prek over pre-commit scverse/cookiecutter-scverse#517@grstin Recommend uv for installation (alternative) scverse/cookiecutter-scverse#531@ilan-goldin fix: typo scverse/cookiecutter-scverse#461Template sync, docs, and initialization (changes do not affect instance repos)
@grstin Fix docs on migrating to the template scverse/cookiecutter-scverse#476@flying-sheepin Add docs link to PR comment scverse/cookiecutter-scverse#478@moinfarin Fix cruft changing .git and add info on manual template update scverse/cookiecutter-scverse#479@grstwith@Copilotin Improve PyPI release instructions in template_usage.md scverse/cookiecutter-scverse#490@grstin Switch to github app for PR creation scverse/cookiecutter-scverse#488@grstin Do not trigger cruft workflow on pre-releases scverse/cookiecutter-scverse#507@ilia-katsin add contents:read permission to test workflow scverse/cookiecutter-scverse#482@grstin Take up template sync where it got interrupted scverse/cookiecutter-scverse#487@mentionsin template update PR bodies by@grstwith@Copilotin Escape GitHub @mentions in template update PR bodies scverse/cookiecutter-scverse#491@grstin Do not mandate global git config scverse/cookiecutter-scverse#518@grstin fix: template sync no longer breaks from multiple choice options scverse/cookiecutter-scverse#527@flying-sheepin fix: mention casing in publisher docs scverse/cookiecutter-scverse#470@grstin Allow user to choose between issue type and labels scverse/cookiecutter-scverse#511Additional remarks
add
skip: truetotemplate-repos.ymlusing a PR or,if you never want to sync from the template again, delete the
.cruft.jsonfile in the root of your repository.Make sure to activate those apps if you haven't already.