From 8deeb95bd2604e186f87c42a5f88e27024b73698 Mon Sep 17 00:00:00 2001 From: "scverse-pr-creator[bot]" <272303624+scverse-pr-creator[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 08:37:52 +0000 Subject: [PATCH 1/4] Update instance repo from cookiecutter template --- .cruft.json | 4 ++-- .pre-commit-config.yaml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.cruft.json b/.cruft.json index b3d4501..604fad7 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "commit": "6cca9704e02edc716fa4665258aa2eb4518be78e", + "commit": "c76f655ce4d1b08c65689b1374d98ca6ce14e4a6", "checkout": null, "context": { "cookiecutter": { @@ -36,7 +36,7 @@ "trim_blocks": true }, "_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "_commit": "6cca9704e02edc716fa4665258aa2eb4518be78e" + "_commit": "c76f655ce4d1b08c65689b1374d98ca6ce14e4a6" } }, "directory": null diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b852368..14c3ff4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,3 +36,8 @@ repos: # Check that there are no merge conflicts (could be generated by template sync) - id: check-merge-conflict args: [--assume-in-merge] + + - repo: https://github.com/zizmorcore/zizmor-pre-commit + rev: v1.24.1 + hooks: + - id: zizmor From 6b8a28671422c7f086cec8f9d4028b0b056bf1d0 Mon Sep 17 00:00:00 2001 From: "scverse-pr-creator[bot]" <272303624+scverse-pr-creator[bot]@users.noreply.github.com> Date: Mon, 8 Jun 2026 06:24:34 +0000 Subject: [PATCH 2/4] Update instance repo from cookiecutter template --- .pre-commit-config.yaml | 6 +++--- pyproject.toml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14c3ff4..7155de8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,16 +7,16 @@ default_stages: minimum_pre_commit_version: 2.16.0 repos: - repo: https://github.com/biomejs/pre-commit - rev: v2.4.13 + rev: v2.4.16 hooks: - id: biome-format exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually. - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.21.1 + rev: v2.23.0 hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.12 + rev: v0.15.15 hooks: - id: ruff-check types_or: [python, pyi, jupyter] diff --git a/pyproject.toml b/pyproject.toml index e1b18d7..98dfc84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,11 +60,10 @@ doc = [ [tool.hatch] envs.default.installer = "uv" envs.default.dependency-groups = [ "dev" ] -envs.docs.dependency-groups = [ "doc" ] envs.docs.scripts.build = "sphinx-build -M html docs docs/_build -W {args}" -envs.docs.scripts.open = "python -m webbrowser -t docs/_build/html/index.html" envs.docs.scripts.clean = "git clean -fdX -- {args:docs}" -envs.hatch-test.dependency-groups = [ "dev", "test" ] +envs.docs.scripts.open = "python -m webbrowser -t docs/_build/html/index.html" +envs.docs.dependency-groups = [ "doc" ] envs.hatch-test.matrix = [ # Test the lowest and highest supported Python versions with normal deps { deps = [ "stable" ], python = [ "3.11", "3.14" ] }, @@ -74,8 +73,9 @@ envs.hatch-test.matrix = [ # If the matrix variable `deps` is set to "pre", # set the environment variable `UV_PRERELEASE` to "allow". envs.hatch-test.overrides.matrix.deps.env-vars = [ - { key = "UV_PRERELEASE", value = "allow", if = [ "pre" ] }, + { value = "allow", key = "UV_PRERELEASE", if = [ "pre" ] }, ] +envs.hatch-test.dependency-groups = [ "dev", "test" ] [tool.ruff] line-length = 120 @@ -116,11 +116,11 @@ lint.per-file-ignores."tests/*" = [ "D" ] lint.pydocstyle.convention = "numpy" [tool.pytest] -strict = true -testpaths = [ "tests" ] addopts = [ "--import-mode=importlib", # allow using test files with same name ] +strict = true +testpaths = [ "tests" ] [tool.coverage] run.omit = [ From 4729ca4b624d744868f589ff5188a4107804ff45 Mon Sep 17 00:00:00 2001 From: "scverse-pr-creator[bot]" <272303624+scverse-pr-creator[bot]@users.noreply.github.com> Date: Tue, 9 Jun 2026 13:45:48 +0000 Subject: [PATCH 3/4] Update instance repo from cookiecutter template --- .cruft.json | 4 ++-- .github/workflows/test.yaml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.cruft.json b/.cruft.json index 604fad7..6471eb8 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "commit": "c76f655ce4d1b08c65689b1374d98ca6ce14e4a6", + "commit": "5a017ae9269e1f624da099f48903775fb3b468c7", "checkout": null, "context": { "cookiecutter": { @@ -36,7 +36,7 @@ "trim_blocks": true }, "_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "_commit": "c76f655ce4d1b08c65689b1374d98ca6ce14e4a6" + "_commit": "5a017ae9269e1f624da099f48903775fb3b468c7" } }, "directory": null diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 986686d..c537745 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -48,6 +48,7 @@ jobs: needs: get-environments permissions: id-token: write # for codecov OIDC + contents: read strategy: fail-fast: false @@ -85,7 +86,7 @@ jobs: uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload - name: Upload coverage - uses: codecov/codecov-action@v5 + uses: codecov/codecov-action@v6 with: fail_ci_if_error: true use_oidc: true From f731ceda5c29d3ed9aa51ae4096f2b78ae8a6c9a Mon Sep 17 00:00:00 2001 From: "scverse-pr-creator[bot]" <272303624+scverse-pr-creator[bot]@users.noreply.github.com> Date: Sat, 11 Jul 2026 18:39:00 +0000 Subject: [PATCH 4/4] Update instance repo from cookiecutter template --- .cruft.json | 5 ++-- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/workflows/test.yaml | 2 +- .pre-commit-config.yaml | 6 ++--- .readthedocs.yaml | 2 +- CHANGELOG.md | 4 ++-- README.md | 6 ++--- docs/conf.py | 6 ++--- docs/contributing.md | 28 ++++++++++++---------- docs/notebooks/example.ipynb | 5 +++- docs/template_usage.md | 18 ++++++++------ pyproject.toml | 2 +- 13 files changed, 49 insertions(+), 39 deletions(-) diff --git a/.cruft.json b/.cruft.json index 6471eb8..1a497cc 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "commit": "5a017ae9269e1f624da099f48903775fb3b468c7", + "commit": "cb7f635331b7fbf10150a978f8e18b0e082aa8cd", "checkout": null, "context": { "cookiecutter": { @@ -13,6 +13,7 @@ "github_repo": "cookiecutter-scverse-instance", "license": "BSD 3-Clause License", "ide_integration": true, + "issue_categorization": "labels", "_copy_without_render": [ ".github/workflows/build.yaml", ".github/workflows/test.yaml", @@ -36,7 +37,7 @@ "trim_blocks": true }, "_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "_commit": "5a017ae9269e1f624da099f48903775fb3b468c7" + "_commit": "cb7f635331b7fbf10150a978f8e18b0e082aa8cd" } }, "directory": null diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 6104b9e..cc32eda 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: Bug report description: Report something that is broken or incorrect -type: Bug +labels: bug body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index e9a58c2..3466756 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,6 +1,6 @@ name: Feature request description: Propose a new feature for cookiecutter-scverse-instance -type: Enhancement +labels: enhancement body: - type: textarea id: description diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c537745..411a5d7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -81,7 +81,7 @@ jobs: run: uvx hatch run ${{ matrix.env.name }}:run-cov -v --color=yes -n auto - name: generate coverage report run: | - # See https://coverage.readthedocs.io/en/latest/config.html#run-patch + # See https://coverage.readthedocs.io/page/config.html#run-patch test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7155de8..d0d001f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,16 +7,16 @@ default_stages: minimum_pre_commit_version: 2.16.0 repos: - repo: https://github.com/biomejs/pre-commit - rev: v2.4.16 + rev: v2.5.2 hooks: - id: biome-format exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually. - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.23.0 + rev: v2.25.1 hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.15 + rev: v0.15.20 hooks: - id: ruff-check types_or: [python, pyi, jupyter] diff --git a/.readthedocs.yaml b/.readthedocs.yaml index bd0b1f5..67eb948 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,4 +1,4 @@ -# https://docs.readthedocs.io/en/stable/config-file/v2.html +# https://docs.readthedocs.io/page/config-file/v2.html version: 2 build: os: ubuntu-24.04 diff --git a/CHANGELOG.md b/CHANGELOG.md index c185628..d3781c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog][], and this project adheres to [Semantic Versioning][]. -[keep a changelog]: https://keepachangelog.com/en/1.0.0/ -[semantic versioning]: https://semver.org/spec/v2.0.0.html +[keep a changelog]: https://keepachangelog.com/ +[semantic versioning]: https://semver.org/ ## [Unreleased] diff --git a/README.md b/README.md index 73530c7..c009cd7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ [![Documentation][badge-docs]][documentation] [badge-tests]: https://img.shields.io/github/actions/workflow/status/scverse/cookiecutter-scverse-instance/test.yaml?branch=main -[badge-docs]: https://img.shields.io/readthedocs/cookiecutter-scverse-instance +[badge-docs]: https://app.readthedocs.org/projects/cookiecutter-scverse-instance/badge/ An example repo generated from the `cookiecutter-scverse` template. @@ -52,6 +52,6 @@ If you found a bug, please use the [issue tracker][]. [issue tracker]: https://github.com/scverse/cookiecutter-scverse-instance/issues [tests]: https://github.com/scverse/cookiecutter-scverse-instance/actions/workflows/test.yaml [documentation]: https://cookiecutter-scverse-instance.readthedocs.io -[changelog]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/changelog.html -[api documentation]: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/api.html +[changelog]: https://cookiecutter-scverse-instance.readthedocs.io/page/changelog.html +[api documentation]: https://cookiecutter-scverse-instance.readthedocs.io/page/api.html [pypi]: https://pypi.org/project/cookiecutter-scverse-instance diff --git a/docs/conf.py b/docs/conf.py index 98be18d..c010b8d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,7 +2,7 @@ # This file only contains a selection of the most common options. For a full # list see the documentation: -# https://www.sphinx-doc.org/en/master/usage/configuration.html +# https://www.sphinx-doc.org/page/usage/configuration.html # -- Path setup -------------------------------------------------------------- import shutil @@ -97,8 +97,8 @@ intersphinx_mapping = { "python": ("https://docs.python.org/3", None), - "anndata": ("https://anndata.readthedocs.io/en/stable/", None), - "scanpy": ("https://scanpy.readthedocs.io/en/stable/", None), + "anndata": ("https://anndata.scverse.org/en/stable/", None), + "scanpy": ("https://scanpy.scverse.org/en/stable/", None), "numpy": ("https://numpy.org/doc/stable/", None), } diff --git a/docs/contributing.md b/docs/contributing.md index 5efb67d..d802d34 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -9,7 +9,7 @@ the [scientific Python tutorials][], or the [scanpy developer guide][]. [pyopensci tutorials]: https://www.pyopensci.org/learn.html [scientific Python tutorials]: https://learn.scientific-python.org/development/tutorials/ -[scanpy developer guide]: https://scanpy.readthedocs.io/en/latest/dev/index.html +[scanpy developer guide]: https://scanpy.scverse.org/page/dev/ :::{tip} The *hatch* project manager @@ -138,21 +138,22 @@ The `.venv` directory is typically automatically discovered by IDEs such as VS C ## Code-style -This package uses [pre-commit][] to enforce consistent code-styles. -On every commit, pre-commit checks will either automatically fix issues with the code, or raise an error message. +This package uses [pre-commit][]-style hooks to enforce consistent code-styles. +We recommend running them with [prek][], a fast, drop-in replacement for `pre-commit` that reads the same `.pre-commit-config.yaml`. +On every commit, the checks will either automatically fix issues with the code, or raise an error message. See [pre-commit checks](template_usage.md#pre-commit-checks) for a full list of checks enabled for this repository. -To enable pre-commit locally, simply run +To enable the checks locally, install [prek][] (e.g. with `uv tool install prek`) and run ```bash -pre-commit install +prek install ``` in the root of the repository. -Pre-commit will automatically download all dependencies when it is run for the first time. +prek will automatically download all dependencies when it is run for the first time. Alternatively, you can rely on the [pre-commit.ci][] service enabled on GitHub. -If you didn’t run `pre-commit` before pushing changes to GitHub it will automatically commit fixes to your pull request, or show an error message. +If you didn’t run the checks before pushing changes to GitHub it will automatically commit fixes to your pull request, or show an error message. If pre-commit.ci added a commit on a branch you still have been working on locally, simply use @@ -161,12 +162,13 @@ git pull --rebase ``` to integrate the changes into yours. -While the [pre-commit.ci][] is useful, we strongly encourage installing and running pre-commit locally first to understand its usage. +While the [pre-commit.ci][] is useful, we strongly encourage installing and running the checks locally first to understand their usage. Finally, most editors have an _autoformat on save_ feature. Consider enabling this option for [ruff][ruff-editors] and [biome][biome-editors]. [pre-commit]: https://pre-commit.com/ +[prek]: https://prek.j178.dev/ [pre-commit.ci]: https://pre-commit.ci/ [ruff-editors]: https://docs.astral.sh/ruff/integrations/ [biome-editors]: https://biomejs.dev/guides/integrate-in-editor/ @@ -275,11 +277,11 @@ This project uses [sphinx][] with the following features: See scanpy’s {doc}`scanpy:dev/documentation` for more information on how to write your own. -[sphinx]: https://www.sphinx-doc.org/en/master/ -[myst]: https://myst-parser.readthedocs.io/en/latest/intro.html -[myst-nb]: https://myst-nb.readthedocs.io/en/latest/ -[numpydoc-napoleon]: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html -[numpydoc]: https://numpydoc.readthedocs.io/en/latest/format.html +[sphinx]: https://www.sphinx-doc.org/ +[myst]: https://myst-parser.readthedocs.io/page/intro.html +[myst-nb]: https://myst-nb.readthedocs.io/ +[numpydoc-napoleon]: https://www.sphinx-doc.org/page/usage/extensions/napoleon.html +[numpydoc]: https://numpydoc.readthedocs.io/page/format.html [sphinx-autodoc-typehints]: https://github.com/tox-dev/sphinx-autodoc-typehints ### Tutorials with myst-nb and jupyter notebooks diff --git a/docs/notebooks/example.ipynb b/docs/notebooks/example.ipynb index fe48d7f..527c6ab 100644 --- a/docs/notebooks/example.ipynb +++ b/docs/notebooks/example.ipynb @@ -45,7 +45,10 @@ "\n", "Again, check the raw markdown of this cell to see how each of these links are specified.\n", "\n", - "You can read more about this in the [intersphinx page](https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html) and the [myst page](https://myst-parser.readthedocs.io/en/v0.15.1/syntax/syntax.html#roles-an-in-line-extension-point)." + "You can read more about this in the [intersphinx page] and the [myst page].\n", + "\n", + "[intersphinx page]: https://www.sphinx-doc.org/page/usage/extensions/intersphinx.html\n", + "[myst page]: https://myst-parser.readthedocs.io/page/syntax/roles-and-directives.html#roles-an-in-line-extension-point" ] }, { diff --git a/docs/template_usage.md b/docs/template_usage.md index 09df61b..8f403eb 100644 --- a/docs/template_usage.md +++ b/docs/template_usage.md @@ -48,7 +48,7 @@ While the repository at this point can be directly used, there are few remaining Modern Python package management uses a `pyproject.toml` that was first introduced in [PEP 518](https://peps.python.org/pep-0518/). This file contains build system requirements and information, which are used by pip to build the package, and tool configurations. -For more details please have a look at [pip's description of the pyproject.toml file](https://pip.pypa.io/en/stable/reference/build-system/pyproject-toml/). +For more details please have a look at [pip's description of the pyproject.toml file](https://pip.pypa.io/page/reference/build-system/). It also serves as a single point of truth to define test environments and how docs are built by leveraging the [hatch][] project manager, but more about that in the [contributing guide](contributing.md). @@ -113,10 +113,10 @@ On the RTD dashboard choose "Import a Project" and follow the instructions to ad For more information, please refer to the [official RTD documentation][rtd-prs]. If your project is private, there are ways to enable docs rendering on [readthedocs.org][] but it is more cumbersome and requires a different RTD subscription. -See a guide [here](https://docs.readthedocs.io/en/stable/guides/importing-private-repositories.html). +See a guide [here](https://docs.readthedocs.io/page/guides/importing-private-repositories.html). [readthedocs.org]: https://readthedocs.org/ -[rtd-prs]: https://docs.readthedocs.io/en/stable/pull-requests.html +[rtd-prs]: https://docs.readthedocs.io/page/pull-requests.html (github-actions)= @@ -179,6 +179,9 @@ the project will be published only once you release your package for the first t This template uses a number of pre-commit checks. In this section we'll detail what is used, where they're defined, and how to modify these checks. +To run the checks locally, we recommend [prek][], a fast, drop-in replacement for `pre-commit` that reads the same `.pre-commit-config.yaml`. +Install it (e.g. with `uv tool install prek`) and run `prek install` once to set up the git hook, then `prek run --all-files` to check the whole repository. + ### Pre-commit CI @@ -299,8 +302,9 @@ add it to Ruff’s [`external = [...]`][ruff-external] setting to prevent `RUF10 [biome]: https://biomejs.dev/ [pre-commit]: https://pre-commit.com/ +[prek]: https://prek.j178.dev/ [pre-commit.ci]: https://pre-commit.ci/ -[pyproject-fmt]: https://pyproject-fmt.readthedocs.io/en/latest/index.html +[pyproject-fmt]: https://pyproject-fmt.readthedocs.io/ [ruff]: https://docs.astral.sh/ruff/ [ruff-config]: https://docs.astral.sh/ruff/configuration/ [ruff-error-suppression]: https://docs.astral.sh/ruff/linter/#error-suppression @@ -322,7 +326,7 @@ there may also be good reasons to choose a different approach, e.g. using an obj [anndata]: https://github.com/scverse/anndata [mudata]: https://github.com/scverse/mudata -[scanpy-api]: https://scanpy.readthedocs.io/en/stable/usage-principles.html +[scanpy-api]: https://scanpy.scverse.org/page/usage-principles.html [spatialdata]: https://github.com/scverse/spatialdata (vcs-based-versioning)= @@ -393,7 +397,7 @@ The following hints may be useful to work with the template sync: If you prefer to check for and apply the pre-release template updates manually, or if you are working on a private repository not tracked by the bot, you can use cruft. Simply: -- Make sure cruft and pre-commit are installed. +- Make sure cruft and prek are installed. - Make sure your git directory is clean (no unstaged/uncommitted files). - Run `cruft update` in the root of your repository. @@ -417,7 +421,7 @@ Here's one way how to do it: ```bash mkdir template && cd template - uvx --with pre-commit cruft create https://github.com/scverse/cookiecutter-scverse + uvx --with prek cruft create https://github.com/scverse/cookiecutter-scverse ``` 4. remove everything from the existing repo diff --git a/pyproject.toml b/pyproject.toml index 98dfc84..ce96b8e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ urls.Source = "https://github.com/scverse/cookiecutter-scverse-instance" [dependency-groups] dev = [ - "pre-commit", + "prek", "twine>=4.0.2", ] test = [