From 35a0a9f04ffcc89d7e5479a1f3f2ea95ba3f629f Mon Sep 17 00:00:00 2001 From: Adam Bolte Date: Mon, 30 Mar 2026 19:33:29 +1100 Subject: [PATCH 1/2] Have Hatch default to Python 3.11 This is the minimum supported version of Python per the default pyproject.toml config. --- {{cookiecutter.package_name}}/pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/{{cookiecutter.package_name}}/pyproject.toml b/{{cookiecutter.package_name}}/pyproject.toml index 10f06ea..844282f 100644 --- a/{{cookiecutter.package_name}}/pyproject.toml +++ b/{{cookiecutter.package_name}}/pyproject.toml @@ -70,6 +70,9 @@ only-include = [ [tool.hatch.build.targets.wheel] packages = ["src/{{cookiecutter.package_name}}"] +[tool.hatch.envs.default] +python = "3.11" + [tool.hatch.envs.hatch-test] extra-dependencies = [ "pytest", From bfbe5c7a5247c5d48629083d59babd51685d1e82 Mon Sep 17 00:00:00 2001 From: Adam Bolte Date: Mon, 30 Mar 2026 20:12:50 +1100 Subject: [PATCH 2/2] Set style env to Python 3.14 This change avoids the following warning from black: Python 3.12 cannot parse code formatted for Python 3.14. To fix this: run Black with Python 3.14, set --target-version to py312, or use --fast to skip the safety check. Black's safety check verifies equivalence by parsing the AST, which fails when the running Python is older than the target version. --- {{cookiecutter.package_name}}/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.package_name}}/pyproject.toml b/{{cookiecutter.package_name}}/pyproject.toml index 844282f..3d44044 100644 --- a/{{cookiecutter.package_name}}/pyproject.toml +++ b/{{cookiecutter.package_name}}/pyproject.toml @@ -131,6 +131,7 @@ extra-dependencies = [ check = "pylint src tests examples" [tool.hatch.envs.style] +python = "3.14" detached = true extra-dependencies = [ "black",