From 9288b41dd2218ef138a4051231126cf8a11757fc Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Mon, 12 Jan 2026 19:20:27 -0800 Subject: [PATCH 1/4] Update Poetry, Python versions in template --- {{cookiecutter.project_name}}/.github/workflows/cd.yml | 4 ++-- {{cookiecutter.project_name}}/.github/workflows/ci.yml | 3 ++- {{cookiecutter.project_name}}/.github/workflows/container.yml | 4 ++-- {{cookiecutter.project_name}}/pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/cd.yml b/{{cookiecutter.project_name}}/.github/workflows/cd.yml index 4352a9d..dde39e4 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/cd.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/cd.yml @@ -4,8 +4,8 @@ name: Release env: ENABLE_PYPI_PUBLISH: {{ "true" if cookiecutter.enable_pypi_publish|lower == "yes" else "false" }} ENABLE_TEST_PYPI_PUBLISH: false - RELEASE_PYTHON_VERSION: "3.12" - RELEASE_POETRY_VERSION: "2.0" + RELEASE_PYTHON_VERSION: "3.14" + RELEASE_POETRY_VERSION: "2.2" on: push: diff --git a/{{cookiecutter.project_name}}/.github/workflows/ci.yml b/{{cookiecutter.project_name}}/.github/workflows/ci.yml index 8d19d79..343501b 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/ci.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/ci.yml @@ -25,8 +25,9 @@ jobs: - "3.11" - "3.12" - "3.13" + - "3.14" poetry-version: - - "2.0" + - "2.2" runs-on: ${{ "{{" }} matrix.os }}-latest steps: diff --git a/{{cookiecutter.project_name}}/.github/workflows/container.yml b/{{cookiecutter.project_name}}/.github/workflows/container.yml index 5bbc5ee..23521aa 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/container.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/container.yml @@ -4,8 +4,8 @@ name: Build env: REGISTRY: ghcr.io IMAGE_NAME: ${{ "{{" }} github.repository }} - RELEASE_PYTHON_VERSION: "3.12" - RELEASE_POETRY_VERSION: "2.0" + RELEASE_PYTHON_VERSION: "3.14" + RELEASE_POETRY_VERSION: "2.2" on: pull_request: diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index b33e33d..ee20436 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -15,7 +15,7 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", ] -requires-python = ">=3.9,<4.0" +requires-python = ">=3.10,<4.0" dynamic = [ "version" ] dependencies = [ ] From dc912530149a42fbfdaefae3f2fa671a78105925 Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Mon, 12 Jan 2026 19:20:28 -0800 Subject: [PATCH 2/4] Replace multiple Python linters with `ruff` --- .../.pre-commit-config.yaml | 32 +++---------- {{cookiecutter.project_name}}/pyproject.toml | 45 +++++++++++-------- 2 files changed, 32 insertions(+), 45 deletions(-) diff --git a/{{cookiecutter.project_name}}/.pre-commit-config.yaml b/{{cookiecutter.project_name}}/.pre-commit-config.yaml index c4d498b..141017b 100644 --- a/{{cookiecutter.project_name}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_name}}/.pre-commit-config.yaml @@ -7,16 +7,12 @@ repos: - id: debug-statements - id: end-of-file-fixer - id: trailing-whitespace - - repo: https://github.com/psf/black - rev: 23.1.0 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.14 hooks: - - id: black - args: ["--config", "pyproject.toml"] - - repo: https://github.com/pycqa/isort - rev: 5.12.0 - hooks: - - id: isort - args: ["--show-config"] + - id: ruff + args: ["--fix"] + - id: ruff-format - repo: https://github.com/pycqa/bandit rev: 1.7.4 hooks: @@ -24,24 +20,6 @@ repos: additional_dependencies: ['.[toml]'] args: ["--configfile", "pyproject.toml"] exclude: '^tests/' - - repo: https://github.com/pycqa/flake8 - rev: 6.0.0 - hooks: - - id: flake8 - additional_dependencies: - - flake8-bugbear - - flake8-pyproject - - flake8-simplify - - pep8-naming - - repo: https://github.com/pycqa/autoflake - rev: v2.0.1 - hooks: - - id: autoflake - - repo: https://github.com/asottile/pyupgrade - rev: v3.3.1 - hooks: - - id: pyupgrade - args: ["--py39-plus", "--keep-runtime-typing"] - repo: local hooks: - id: mypy diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index ee20436..e16f9df 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -31,21 +31,15 @@ poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] } [tool.poetry.group.dev.dependencies] bandit = {extras = ["toml"], version = "*"} -black = "*" cruft = "*" -flake8 = "*" -flake8-bugbear = "*" -flake8-pyproject = "*" -flake8-simplify = "*" -isort = "*" mypy = "*" -pep8-naming = "*" poethepoet = "*" pre-commit = "*" pytest = "*" pytest-cov = "*" pytest-github-actions-annotate-failures = "*" pytest-sugar = "*" +ruff = "*" [tool.poetry-dynamic-versioning] enable = true @@ -67,9 +61,6 @@ help = "Run all tests" [tool.bandit] skips = ["B101"] # assert_used -[tool.black] -line-length = 79 - [tool.coverage.run] source = ["{{ cookiecutter.project_slug }}"] @@ -80,14 +71,6 @@ show_missing = true [tool.cruft] skip = [".git"] -[tool.flake8] -exclude = "./.*" - -[tool.isort] -atomic = true -profile = "black" -line_length = 79 - [tool.mypy] files = [ "tests", "{{ cookiecutter.project_slug }}" ] mypy_path = "types" @@ -107,4 +90,30 @@ addopts = """\ --junitxml=.pytest_results.xml \ """ +[tool.ruff] +target-version = "py310" +line-length = 79 +fix = true + +select = [ + "E", "W", # pycodestyle + "F", # pyflakes + "I", # isort + "B", # bugbear + "SIM", # flake8-simplify + "N", # pep8-naming + "UP", # pyupgrade +] + +exclude = [ + ".git", + ".venv", + "__pycache__", +] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +line-ending = "auto" + # vim: ft=cfg From 4982dd0a5ea8c00813b9390363a9b11af24fba18 Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Mon, 12 Jan 2026 19:20:28 -0800 Subject: [PATCH 3/4] Update template `.pre-commit-config.yaml` whitespace --- .../.pre-commit-config.yaml | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/{{cookiecutter.project_name}}/.pre-commit-config.yaml b/{{cookiecutter.project_name}}/.pre-commit-config.yaml index 141017b..aa79b5b 100644 --- a/{{cookiecutter.project_name}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_name}}/.pre-commit-config.yaml @@ -1,29 +1,29 @@ repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 - hooks: - - id: check-yaml - - id: check-merge-conflict - - id: debug-statements - - id: end-of-file-fixer - - id: trailing-whitespace - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 - hooks: - - id: ruff - args: ["--fix"] - - id: ruff-format - - repo: https://github.com/pycqa/bandit - rev: 1.7.4 - hooks: - - id: bandit - additional_dependencies: ['.[toml]'] - args: ["--configfile", "pyproject.toml"] - exclude: '^tests/' - - repo: local - hooks: - - id: mypy - name: mypy - language: python - types_or: [python, pyi] - entry: env -u VIRTUAL_ENV poetry run mypy +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-yaml + - id: check-merge-conflict + - id: debug-statements + - id: end-of-file-fixer + - id: trailing-whitespace +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.14 + hooks: + - id: ruff + args: ["--fix"] + - id: ruff-format +- repo: https://github.com/pycqa/bandit + rev: 1.7.4 + hooks: + - id: bandit + additional_dependencies: ['.[toml]'] + args: ["--configfile", "pyproject.toml"] + exclude: '^tests/' +- repo: local + hooks: + - id: mypy + name: mypy + language: python + types_or: [python, pyi] + entry: env -u VIRTUAL_ENV poetry run mypy From 08c79422724911840e0f2ee3ea3e2a7485be7563 Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Mon, 12 Jan 2026 19:45:11 -0800 Subject: [PATCH 4/4] Update pre-commit hook versions in template --- {{cookiecutter.project_name}}/.pre-commit-config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_name}}/.pre-commit-config.yaml b/{{cookiecutter.project_name}}/.pre-commit-config.yaml index aa79b5b..d36e7be 100644 --- a/{{cookiecutter.project_name}}/.pre-commit-config.yaml +++ b/{{cookiecutter.project_name}}/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: check-yaml - id: check-merge-conflict @@ -8,13 +8,13 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.14 + rev: v0.14.11 hooks: - id: ruff args: ["--fix"] - id: ruff-format - repo: https://github.com/pycqa/bandit - rev: 1.7.4 + rev: 1.9.2 hooks: - id: bandit additional_dependencies: ['.[toml]']