From 9a29eda4cf04dc2c47b9ccaa21bb28cfd8175d6b Mon Sep 17 00:00:00 2001 From: Simon van Lierde Date: Fri, 23 Oct 2026 18:48:25 +0000 Subject: [PATCH] docs: move the example's ruff settings to tool.ruff.lint - ruff deprecated top-level select and isort in 0.2.0; update the example and the literalinclude markers that show it - measure coverage on examplePy, not on a module named test --- examples/pure-hatch/pyproject.toml | 6 +++--- package-structure-code/code-style-linting-format.md | 6 +++--- package-structure-code/declare-dependencies.md | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/pure-hatch/pyproject.toml b/examples/pure-hatch/pyproject.toml index c29ad0637..d0a0bb429 100644 --- a/examples/pure-hatch/pyproject.toml +++ b/examples/pure-hatch/pyproject.toml @@ -62,7 +62,7 @@ plot = ["bokeh"] test = ["pytest", "pytest-cov"] docs = ["sphinx", "pydata-sphinx-theme"] -[tool.ruff] +[tool.ruff.lint] select = [ "E", # pycodestyle errors "W", # pycodestyle warnings @@ -70,7 +70,7 @@ select = [ "I", # isort ] -[tool.ruff.isort] +[tool.ruff.lint.isort] known-first-party = ["examplePy"] [tool.pytest.ini_options] @@ -86,7 +86,7 @@ dependency-groups = [ ] [tool.hatch.envs.test.scripts] -run = "pytest {args:--cov=test --cov-report=term-missing --cov-report=xml}" +run = "pytest {args:--cov=examplePy --cov-report=term-missing --cov-report=xml}" [[tool.hatch.envs.test.matrix]] python = ["3.10", "3.11", "3.12"] diff --git a/package-structure-code/code-style-linting-format.md b/package-structure-code/code-style-linting-format.md index a14b2b298..5946ce25a 100644 --- a/package-structure-code/code-style-linting-format.md +++ b/package-structure-code/code-style-linting-format.md @@ -209,15 +209,15 @@ Here is a simple configuration to get started with `ruff`. It would go into your :::{literalinclude} ../examples/pure-hatch/pyproject.toml :language: toml -:start-at: [tool.ruff] -:end-before: [tool.ruff.isort] +:start-at: [tool.ruff.lint] +:end-before: [tool.ruff.lint.isort] ::: Depending on your project, you might want to add the following to sort imports correctly: :::{literalinclude} ../examples/pure-hatch/pyproject.toml :language: toml -:start-at: [tool.ruff.isort] +:start-at: [tool.ruff.lint.isort] :end-before: [tool.pytest.ini_options] ::: diff --git a/package-structure-code/declare-dependencies.md b/package-structure-code/declare-dependencies.md index 3423636c9..e74fc2e6d 100644 --- a/package-structure-code/declare-dependencies.md +++ b/package-structure-code/declare-dependencies.md @@ -373,7 +373,7 @@ You can also create combined groups that reference other groups: :::{literalinclude} ../examples/pure-hatch/pyproject.toml :language: toml :start-at: [project.optional-dependencies] -:end-before: [tool.ruff] +:end-before: [tool.ruff.lint] ::: Then install everything with pip install or uv sync as needed: