diff --git a/.github/assets/cookiecutter-scverse-instance.json b/.github/assets/cookiecutter-scverse-instance.json index 3371cb54..d9c9f605 100644 --- a/.github/assets/cookiecutter-scverse-instance.json +++ b/.github/assets/cookiecutter-scverse-instance.json @@ -1,7 +1,7 @@ { "project_name": "cookiecutter-scverse-instance", "package_name": "cookiecutter_scverse_instance", - "project_description": "An example repo generated from the `cookiecutter-scverse` template. Feel free to look around this repo and check out the docs to find out if the template works for you!", + "project_description": "An example repo generated from the `cookiecutter-scverse` template.", "author_full_name": "scverse community", "author_email": "core-team@scverse.org", "github_user": "scverse", diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe5759d2..7ab7de54 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,17 @@ repos: # Hooks that are run everywhere - repo: https://github.com/biomejs/pre-commit - rev: v2.3.10 + rev: v2.3.14 hooks: - id: biome-format # Hooks that are run for scripts - repo: https://github.com/tox-dev/pyproject-fmt - rev: v2.12.1 + rev: v2.15.1 hooks: - id: pyproject-fmt files: ^scripts/pyproject\.toml$ - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.0 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 1c4cb416..57c3ef3b 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -34,15 +34,13 @@ urls.Source = "https://github.com/scverse/cookiecutter-scverse" scripts.make-rich-output = "scverse_template_scripts.make_rich_output:main" scripts.send-cruft-prs = "scverse_template_scripts.cruft_prs:cli" -[tool.hatch.version] -source = "vcs" -fallback-version = "0.0" +[tool.hatch] +version.source = "vcs" +version.fallback-version = "0.0" [tool.ruff] line-length = 120 - format.docstring-code-format = true - lint.select = [ "A", "ANN", @@ -84,7 +82,7 @@ lint.unfixable = [ "RUF001", # never “fix” “confusables” ] lint.allowed-confusables = [ "×", "’" ] -lint.flake8-type-checking.exempt-modules = [ ] +lint.flake8-type-checking.exempt-modules = [] lint.flake8-type-checking.runtime-evaluated-decorators = [ "cyclopts.App.default" ] lint.flake8-type-checking.strict = true lint.isort.known-first-party = [ "scverse_template_scripts", "testing.scverse_template_scripts" ] @@ -93,7 +91,7 @@ lint.isort.required-imports = [ "from __future__ import annotations" ] [tool.pyproject-fmt] column_width = 120 -[tool.pytest.ini_options] +[tool.pytest] addopts = [ "--import-mode=importlib", ] diff --git a/{{cookiecutter.project_name}}/.pre-commit-config.yaml b/{{cookiecutter.project_name}}/.pre-commit-config.yaml index 74ce081b..e47a4f7a 100644 --- a/{{cookiecutter.project_name}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_name}}/.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.3.10 + rev: v2.3.14 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.12.1 + rev: v2.15.1 hooks: - id: pyproject-fmt - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.14.14 + rev: v0.15.0 hooks: - id: ruff-check types_or: [python, pyi, jupyter] diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 3de9ac3a..52763fb7 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -59,49 +59,34 @@ doc = [ "sphinxext-opengraph", ] -{% if cookiecutter.project_name.lower().replace("-", "_") != cookiecutter.package_name -%} -[tool.hatch.build.targets.wheel] -packages = [ "src/{{ cookiecutter.package_name }}" ] - -{% endif -%} - -[tool.hatch.envs.default] -installer = "uv" -dependency-groups = [ "dev" ] - -[tool.hatch.envs.docs] -dependency-groups = [ "doc" ] -scripts.build = "sphinx-build -M html docs docs/_build -W {args}" -scripts.open = "python -m webbrowser -t docs/_build/html/index.html" -scripts.clean = "git clean -fdX -- {args:docs}" - -[tool.hatch.envs.hatch-test] -dependency-groups = [ "dev", "test" ] - -# Test the lowest and highest supported Python versions with normal deps -[[tool.hatch.envs.hatch-test.matrix]] -deps = [ "stable" ] -python = [ "3.11", "3.14" ] - -# Test the newest supported Python version also with pre-release deps -[[tool.hatch.envs.hatch-test.matrix]] -deps = [ "pre" ] -python = [ "3.14" ] - -[tool.hatch.envs.hatch-test.overrides] +[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.hatch-test.matrix = [ + # Test the lowest and highest supported Python versions with normal deps + { deps = [ "stable" ], python = [ "3.11", "3.14" ] }, + # Test the newest supported Python version also with pre-release deps + { deps = [ "pre" ], python = [ "3.14" ] }, +] # If the matrix variable `deps` is set to "pre", # set the environment variable `UV_PRERELEASE` to "allow". -matrix.deps.env-vars = [ +envs.hatch-test.overrides.matrix.deps.env-vars = [ { key = "UV_PRERELEASE", value = "allow", if = [ "pre" ] }, ] +{% if cookiecutter.project_name.lower().replace("-", "_") != cookiecutter.package_name -%} +build.targets.wheel.packages = [ "src/{{ cookiecutter.package_name }}" ] +{% endif %} [tool.ruff] line-length = 120 src = [ "src" ] extend-include = [ "*.ipynb" ] - format.docstring-code-format = true - lint.select = [ "B", # flake8-bugbear "BLE", # flake8-blind-except @@ -142,12 +127,12 @@ addopts = [ "--import-mode=importlib", # allow using test files with same name ] -[tool.coverage.run] -source = [ "{{ cookiecutter.package_name }}" ] -patch = [ "subprocess" ] -omit = [ +[tool.coverage] +run.omit = [ "**/test_*.py", ] +run.patch = [ "subprocess" ] +run.source = [ "{{ cookiecutter.package_name }}" ] [tool.cruft] skip = [