Skip to content

Commit e05ca9f

Browse files
authored
Merge pull request #48 from robust-python/develop
Update to Python 3.10-3.14 along with other fixes
2 parents 8dd2951 + b34f76d commit e05ca9f

18 files changed

+144
-332
lines changed

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
build:
44
os: ubuntu-22.04
55
tools:
6-
python: "3.13"
6+
python: "3.14"
77

88
python:
99
install:

.ruff.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ exclude = [
3535
line-length = 120
3636
indent-width = 4
3737

38-
# Assume Python 3.9
39-
target-version = "py39"
38+
# Assume Python 3.10
39+
target-version = "py310"
4040

4141
[lint]
4242
# https://docs.astral.sh/ruff/rules

cookiecutter.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"project_name": "robust-python-demo",
33
"package_name": "{{ cookiecutter.project_name.replace('-', '_') }}",
44
"friendly_name": "{{ cookiecutter.project_name.replace('-', ' ').title() }}",
5-
"min_python_version": "3.9",
6-
"max_python_version": "3.13",
5+
"min_python_version": "3.10",
6+
"max_python_version": "3.14",
77
"add_rust_extension": false,
88
"author": "First Last",
99
"email": "cookiecutter.robust.python@gmail.com",

docs/getting-started-template-contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This section is for contributors looking to work on the `cookiecutter-robust-pyt
77
To contribute to the template, you will need:
88

99
1. **Git**: For version control.
10-
2. **Python 3.9+**: We recommend using a supported Python version.
10+
2. **Python 3.10+**: We recommend using a supported Python version.
1111
3. **uv**: Our chosen dependency manager (see [Dependency Management (02)](topics/02_dependency-management.md)). Install `uv` globally or in a base environment following the official {uv-install}`uv installation guide<>`.
1212
4. **Docker or Podman**: Required for testing the containerization aspects of the generated template (see [Container Build (11)](topics/11_container-build.md), [Dev Containers (17)](topics/17_dev-containers.md)).
1313
5. **Task Automation Tools**: The template uses `noxfile.py` for development workflows. We use `uvx` to run `nox` so that it automatically installs if needed.

docs/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For detailed tool explanations and project philosophy, see the full documentatio
1010

1111
Make sure you have these installed:
1212

13-
- **Python 3.9+** (or your chosen template version).
13+
- **Python 3.10+** (or your chosen template version).
1414
- **Git**.
1515
- **uv**: Our chosen dependency manager. Install it {uv-install}`officially<>`.
1616
- **Docker or Podman**: If you plan to work with containers (most web apps will need this). Install {docker-install}`Docker<>` or {podman-install}`Podman<>`.

noxfile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
nox.options.default_venv_backend = "uv"
1919

20-
DEFAULT_TEMPLATE_PYTHON_VERSION = "3.9"
20+
DEFAULT_TEMPLATE_PYTHON_VERSION = "3.10"
2121

2222
REPO_ROOT: Path = Path(__file__).parent.resolve()
2323
SCRIPTS_FOLDER: Path = REPO_ROOT / "scripts"
@@ -59,7 +59,11 @@
5959
LINT_FROM_DEMO_OPTIONS: tuple[str, ...] = GENERATE_DEMO_OPTIONS
6060

6161
UPDATE_DEMO_SCRIPT: Path = SCRIPTS_FOLDER / "update-demo.py"
62-
UPDATE_DEMO_OPTIONS: tuple[str, ...] = GENERATE_DEMO_OPTIONS
62+
UPDATE_DEMO_OPTIONS: tuple[str, ...] = (
63+
*GENERATE_DEMO_OPTIONS,
64+
*("--min-python-version", "3.10"),
65+
*("--max-python-version", "3.14")
66+
)
6367

6468

6569
@nox.session(python=DEFAULT_TEMPLATE_PYTHON_VERSION, name="generate-demo")

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "cookiecutter-robust-python"
33
version = "0.1.0"
44
description = "Add your description here"
55
readme = "README.md"
6-
requires-python = ">=3.9,<4.0"
6+
requires-python = ">=3.10,<4.0"
77
dependencies = [
88
"cookiecutter>=2.6.0",
99
"cruft>=2.16.0",

scripts/update-demo.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from util import FolderOption
1313
from util import REPO_FOLDER
1414
from util import require_clean_and_up_to_date_repo
15+
from util import uv
1516

1617

1718
cli: typer.Typer = typer.Typer()
@@ -20,7 +21,9 @@
2021
@cli.callback(invoke_without_command=True)
2122
def update_demo(
2223
demos_cache_folder: Annotated[Path, FolderOption("--demos-cache-folder", "-c")],
23-
add_rust_extension: Annotated[bool, typer.Option("--add-rust-extension", "-r")] = False
24+
add_rust_extension: Annotated[bool, typer.Option("--add-rust-extension", "-r")] = False,
25+
min_python_version: Annotated[str, typer.Option("--min-python-version")] = "3.10",
26+
max_python_version: Annotated[str, typer.Option("--max-python-version")] = "3.14"
2427
) -> None:
2528
"""Runs precommit in a generated project and matches the template to the results."""
2629
try:
@@ -31,11 +34,19 @@ def update_demo(
3134
with work_in(demo_path):
3235
require_clean_and_up_to_date_repo()
3336
git("checkout", develop_branch)
37+
uv("python", "pin", min_python_version)
38+
uv("python", "install", min_python_version)
3439
cruft.update(
3540
project_dir=demo_path,
3641
template_path=REPO_FOLDER,
37-
extra_context={"project_name": demo_name, "add_rust_extension": add_rust_extension},
42+
extra_context={
43+
"project_name": demo_name,
44+
"add_rust_extension": add_rust_extension,
45+
"min_python_version": min_python_version,
46+
"max_python_version": max_python_version
47+
},
3848
)
49+
uv("lock")
3950
git("add", ".")
4051
git("commit", "-m", "chore: update demo to the latest cookiecutter-robust-python", "--no-verify")
4152
git("push")

0 commit comments

Comments
 (0)