From 6969d124274cad16a294cc6969ddf25b0c42a0cc Mon Sep 17 00:00:00 2001 From: "scverse-pr-creator[bot]" <272303624+scverse-pr-creator[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 10:51:25 +0000 Subject: [PATCH 1/4] Update instance repo from cookiecutter template --- .cruft.json | 4 ++-- .pre-commit-config.yaml | 8 ++++++-- docs/contributing.md | 6 ++++-- docs/template_usage.md | 2 +- pyproject.toml | 4 +++- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.cruft.json b/.cruft.json index 09f389b..ca33885 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "commit": "31733e798d89018e590c2586962c153d38057dad", + "commit": "d7f546e69b928578a358d78950333563f6934c26", "checkout": null, "context": { "cookiecutter": { @@ -37,7 +37,7 @@ "trim_blocks": true }, "_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "_commit": "31733e798d89018e590c2586962c153d38057dad" + "_commit": "d7f546e69b928578a358d78950333563f6934c26" } }, "directory": null diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0284b58..7bc56f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,18 +11,19 @@ repos: hooks: - id: biome-format exclude: ^\.cruft\.json$ # inconsistent indentation with cruft - file never to be modified manually. + groups: [format] - repo: https://github.com/tox-dev/pyproject-fmt rev: v2.25.3 hooks: - id: pyproject-fmt + groups: [format] - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.15.22 hooks: - id: ruff-check - types_or: [python, pyi, jupyter] args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - types_or: [python, pyi, jupyter] + groups: [format] - repo: local hooks: - id: mypy @@ -39,9 +40,12 @@ repos: - id: detect-private-key - id: check-ast - id: end-of-file-fixer + groups: [format] - id: mixed-line-ending args: [--fix=lf] + groups: [format] - id: trailing-whitespace + groups: [format] - id: check-case-conflict # Check that there are no merge conflicts (could be generated by template sync) - id: check-merge-conflict diff --git a/docs/contributing.md b/docs/contributing.md index 798c1c5..7afcf9b 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -153,10 +153,12 @@ We recommend running them with [prek][], a fast, drop-in replacement for `pre-co 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 the checks locally, install [prek][] (e.g. with `uv tool install prek`) and run +To enable the checks locally, run ```bash -prek install +hatch run hatch-static-analysis:prek install +# or +uvx prek install ``` in the root of the repository. diff --git a/docs/template_usage.md b/docs/template_usage.md index 1a769ab..2524d9d 100644 --- a/docs/template_usage.md +++ b/docs/template_usage.md @@ -194,7 +194,7 @@ 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. +Set up the git hook once by running `prek install` (e.g. `uvx prek install`), then `hatch fmt` to format and check the whole repository. ### Overview of pre-commit hooks used by the template diff --git a/pyproject.toml b/pyproject.toml index 1661a3b..828d28a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,6 @@ urls.Source = "https://github.com/scverse/cookiecutter-scverse-instance" [dependency-groups] dev = [ "mypy", - "prek", "twine>=4.0.2", ] test = [ @@ -77,6 +76,9 @@ envs.hatch-test.overrides.matrix.deps.env-vars = [ { value = "allow", key = "UV_PRERELEASE", if = [ "pre" ] }, ] envs.hatch-test.dependency-groups = [ "dev", "test" ] +envs.hatch-static-analysis.dependencies = [ "prek" ] +envs.hatch-static-analysis.scripts.format-fix = "prek run -a --group=format" +envs.hatch-static-analysis.scripts.lint-fix = "prek run -a --no-group=format" [tool.ruff] line-length = 120 From 067ee38c6d72c45b194392b8f8e9fd6e10c09af7 Mon Sep 17 00:00:00 2001 From: "scverse-pr-creator[bot]" <272303624+scverse-pr-creator[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 11:18:58 +0000 Subject: [PATCH 2/4] Update instance repo from cookiecutter template --- .pre-commit-config.yaml | 3 ++- docs/template_usage.md | 2 +- pyproject.toml | 17 +++++++++++++---- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bc56f9..2f7ed62 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -28,12 +28,13 @@ repos: hooks: - id: mypy name: mypy - entry: uv run --group test mypy src tests + entry: hatch check types language: system types: [python] files: ^(src|tests)/ require_serial: true pass_filenames: false + groups: [typecheck] - repo: https://github.com/pre-commit/pre-commit-hooks rev: v6.0.0 hooks: diff --git a/docs/template_usage.md b/docs/template_usage.md index 2524d9d..b191b70 100644 --- a/docs/template_usage.md +++ b/docs/template_usage.md @@ -194,7 +194,7 @@ 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`. -Set up the git hook once by running `prek install` (e.g. `uvx prek install`), then `hatch fmt` to format and check the whole repository. +Set up the git hook once by running `prek install` (e.g. `uvx prek install`), then `hatch check --fix` to format and check the whole repository. ### Overview of pre-commit hooks used by the template diff --git a/pyproject.toml b/pyproject.toml index 828d28a..627ca78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,6 @@ urls.Source = "https://github.com/scverse/cookiecutter-scverse-instance" [dependency-groups] dev = [ - "mypy", "twine>=4.0.2", ] test = [ @@ -56,6 +55,10 @@ doc = [ "sphinxcontrib-katex", "sphinxext-opengraph", ] +typecheck = [ + "mypy", + # add any stub packages that you might need here +] [tool.hatch] envs.default.installer = "uv" @@ -76,9 +79,15 @@ envs.hatch-test.overrides.matrix.deps.env-vars = [ { value = "allow", key = "UV_PRERELEASE", if = [ "pre" ] }, ] envs.hatch-test.dependency-groups = [ "dev", "test" ] -envs.hatch-static-analysis.dependencies = [ "prek" ] -envs.hatch-static-analysis.scripts.format-fix = "prek run -a --group=format" -envs.hatch-static-analysis.scripts.lint-fix = "prek run -a --no-group=format" +envs.hatch-check-fmt.dependencies = [ "prek" ] +envs.hatch-check-fmt.scripts.format-fix = "prek run -a --group=format --no-group=typecheck" +envs.hatch-check-code.dependencies = [ "prek" ] +envs.hatch-check-code.scripts.lint-fix = "prek run -a --no-group=format --no-group=typecheck" +envs.hatch-check-types.dependencies = [ "mypy" ] +envs.hatch-check-types.scripts.check = [ "mypy" ] + +[tool.mypy] +files = [ "src", "tests" ] [tool.ruff] line-length = 120 From dd0f039c8ce818c139532fd030fd485c45f91014 Mon Sep 17 00:00:00 2001 From: "scverse-pr-creator[bot]" <272303624+scverse-pr-creator[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 11:21:21 +0000 Subject: [PATCH 3/4] Update instance repo from cookiecutter template --- docs/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contributing.md b/docs/contributing.md index 7afcf9b..f31c190 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -156,7 +156,7 @@ See [pre-commit checks](template_usage.md#pre-commit-checks) for a full list of To enable the checks locally, run ```bash -hatch run hatch-static-analysis:prek install +hatch run hatch-check-code:prek install # or uvx prek install ``` From 03a37f7f27611251cefc1ec77db5dbba710a7375 Mon Sep 17 00:00:00 2001 From: "scverse-pr-creator[bot]" <272303624+scverse-pr-creator[bot]@users.noreply.github.com> Date: Fri, 24 Jul 2026 11:24:38 +0000 Subject: [PATCH 4/4] Update instance repo from cookiecutter template --- .cruft.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.cruft.json b/.cruft.json index ca33885..d6a03e3 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "commit": "d7f546e69b928578a358d78950333563f6934c26", + "commit": "ba8ba4359df21973a17be78d182f4a7361727098", "checkout": null, "context": { "cookiecutter": { @@ -37,7 +37,7 @@ "trim_blocks": true }, "_template": "/home/runner/work/cookiecutter-scverse/cookiecutter-scverse", - "_commit": "d7f546e69b928578a358d78950333563f6934c26" + "_commit": "ba8ba4359df21973a17be78d182f4a7361727098" } }, "directory": null