From ac71ca25b0481fd23a1b658f1350c8253156e8af Mon Sep 17 00:00:00 2001 From: Casper van der Wel Date: Tue, 16 Sep 2025 11:35:40 +0200 Subject: [PATCH 1/2] Various improvements to p yproject toml --- pyproject.toml | 7 +------ {{ cookiecutter.project_name }}/pyproject.toml | 13 +++++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index dce5d81..f87a63f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ dependencies = [ "cookiecutter" ] + [project.urls] homepage = "https://github.com/nens/cookiecutter-python-template" @@ -42,9 +43,3 @@ target-version = "py312" [tool.ruff.lint] select = ["E4", "E7", "E9", "F", "I", "UP", "C901"] -[dependency-groups] -dev = [ - "pre-commit>=4.3.0", - "pytest>=8.4.2", - "pytest-sugar>=1.1.1", -] diff --git a/{{ cookiecutter.project_name }}/pyproject.toml b/{{ cookiecutter.project_name }}/pyproject.toml index 31ecddf..d113f2f 100644 --- a/{{ cookiecutter.project_name }}/pyproject.toml +++ b/{{ cookiecutter.project_name }}/pyproject.toml @@ -18,12 +18,12 @@ keywords = [] requires-python = ">=3.12" dependencies = [] +[project.optional-dependencies] +test = ["pytest>=8.4.2", "pytest-cov>=6.3.0", "pytest-sugar>=1.1.1"] + [project.urls] homepage = "https://github.com/nens/{{ cookiecutter.project_name }}" -[tool.pytest.ini_options] -addopts = "--cov --cov-fail-under=80" - [tool.zest-releaser] release = false @@ -38,6 +38,10 @@ select = ["E4", "E7", "E9", "F", "I", "UP", "C901"] [tool.ruff.lint.isort] known-first-party = ["{{ cookiecutter.package_name }}"] + +[tool.ruff.lint.per-file-ignores] +"__init__.py" = ["F401", "F403"] + [tool.pyright] # Pyright/pylance/vscode configuration. # Note: if you want a different setup, you can overwrite this with a @@ -45,6 +49,3 @@ known-first-party = ["{{ cookiecutter.package_name }}"] include = "src" venvPath = "." venv = ".venv" - -[dependency-groups] -dev = ["pytest>=8.4.2", "pytest-cov>=6.3.0", "pytest-sugar>=1.1.1"] From 24f46586cdce62e82653c417483b4b13d68c3b9a Mon Sep 17 00:00:00 2001 From: Casper van der Wel Date: Tue, 16 Sep 2025 11:37:21 +0200 Subject: [PATCH 2/2] Revert and fix --- pyproject.toml | 7 ++++++- {{ cookiecutter.project_name }}/.github/workflows/test.yml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f87a63f..dce5d81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,6 @@ dependencies = [ "cookiecutter" ] - [project.urls] homepage = "https://github.com/nens/cookiecutter-python-template" @@ -43,3 +42,9 @@ target-version = "py312" [tool.ruff.lint] select = ["E4", "E7", "E9", "F", "I", "UP", "C901"] +[dependency-groups] +dev = [ + "pre-commit>=4.3.0", + "pytest>=8.4.2", + "pytest-sugar>=1.1.1", +] diff --git a/{{ cookiecutter.project_name }}/.github/workflows/test.yml b/{{ cookiecutter.project_name }}/.github/workflows/test.yml index bd16ac3..f81e4ca 100644 --- a/{{ cookiecutter.project_name }}/.github/workflows/test.yml +++ b/{{ cookiecutter.project_name }}/.github/workflows/test.yml @@ -5,6 +5,7 @@ on: push: branches: - master + - main pull_request: jobs: