Skip to content

Commit 4f4403d

Browse files
committed
Add Python 3.14 to defaults and remove 3.9
1 parent c350d2e commit 4f4403d

File tree

43 files changed

+75
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+75
-61
lines changed

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
RUST_BACKTRACE: 1
1111
RUSTFLAGS: "-D warnings"
1212
WORKING_DIR: "my-project"
13-
MIN_PYTHON_VERSION: "3.9"
13+
MIN_PYTHON_VERSION: "3.10"
1414
CI: true # For insta
1515
jobs:
1616
clippy:

src/fastapi/docker_files.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,16 +896,17 @@ mod tests {
896896
copyright_year: Some("2023".to_string()),
897897
version: "0.1.0".to_string(),
898898
python_version: "3.11".to_string(),
899-
min_python_version: "3.9".to_string(),
899+
min_python_version: "3.10".to_string(),
900900
project_manager: ProjectManager::Poetry,
901901
pyo3_python_manager: Some(Pyo3PythonManager::Uv),
902902
is_application: true,
903903
is_async_project: false,
904904
github_actions_python_test_versions: vec![
905-
"3.9".to_string(),
906905
"3.10".to_string(),
907906
"3.11".to_string(),
908907
"3.12".to_string(),
908+
"3.13".to_string(),
909+
"3.14".to_string(),
909910
],
910911
max_line_length: 100,
911912
use_dependabot: true,

src/github_actions.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2333,16 +2333,17 @@ mod tests {
23332333
copyright_year: Some("2023".to_string()),
23342334
version: "0.1.0".to_string(),
23352335
python_version: "3.12".to_string(),
2336-
min_python_version: "3.9".to_string(),
2336+
min_python_version: "3.10".to_string(),
23372337
project_manager: ProjectManager::Maturin,
23382338
pyo3_python_manager: Some(Pyo3PythonManager::Uv),
23392339
is_application: true,
23402340
is_async_project: false,
23412341
github_actions_python_test_versions: vec![
2342-
"3.9".to_string(),
23432342
"3.10".to_string(),
23442343
"3.11".to_string(),
23452344
"3.12".to_string(),
2345+
"3.13".to_string(),
2346+
"3.14".to_string(),
23462347
],
23472348
max_line_length: 100,
23482349
use_dependabot: true,
@@ -2379,12 +2380,13 @@ mod tests {
23792380
fn test_build_github_actions_test_versions() {
23802381
assert_eq!(
23812382
build_actions_python_test_versions(&[
2382-
"3.9".to_string(),
23832383
"3.10".to_string(),
23842384
"3.11".to_string(),
23852385
"3.12".to_string(),
2386+
"3.13".to_string(),
2387+
"3.14".to_string(),
23862388
]),
2387-
r#""3.9", "3.10", "3.11", "3.12""#.to_string()
2389+
r#""3.10", "3.11", "3.12", "3.13", "3.14""#.to_string()
23882390
);
23892391
}
23902392

src/licenses.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,17 @@ mod tests {
273273
copyright_year: Some("2023".to_string()),
274274
version: "0.1.0".to_string(),
275275
python_version: "3.11".to_string(),
276-
min_python_version: "3.9".to_string(),
276+
min_python_version: "3.10".to_string(),
277277
project_manager: ProjectManager::Poetry,
278278
pyo3_python_manager: None,
279279
is_application: true,
280280
is_async_project: false,
281281
github_actions_python_test_versions: vec![
282-
"3.9".to_string(),
283282
"3.10".to_string(),
284283
"3.11".to_string(),
284+
"3.12".to_string(),
285+
"3.13".to_string(),
286+
"3.14".to_string(),
285287
],
286288
max_line_length: 100,
287289
use_dependabot: true,

src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,16 +494,17 @@ mod tests {
494494
copyright_year: Some("2023".to_string()),
495495
version: "0.1.0".to_string(),
496496
python_version: "3.12".to_string(),
497-
min_python_version: "3.9".to_string(),
497+
min_python_version: "3.10".to_string(),
498498
project_manager: ProjectManager::Poetry,
499499
pyo3_python_manager: None,
500500
is_application: true,
501501
is_async_project: false,
502502
github_actions_python_test_versions: vec![
503-
"3.9".to_string(),
504503
"3.10".to_string(),
505504
"3.11".to_string(),
506505
"3.12".to_string(),
506+
"3.13".to_string(),
507+
"3.14".to_string(),
507508
],
508509
max_line_length: 100,
509510
use_dependabot: true,

src/project_generator.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,16 +1634,17 @@ mod tests {
16341634
copyright_year: Some("2023".to_string()),
16351635
version: "0.1.0".to_string(),
16361636
python_version: "3.11".to_string(),
1637-
min_python_version: "3.9".to_string(),
1637+
min_python_version: "3.10".to_string(),
16381638
project_manager: ProjectManager::Poetry,
16391639
pyo3_python_manager: Some(Pyo3PythonManager::Uv),
16401640
is_application: true,
16411641
is_async_project: false,
16421642
github_actions_python_test_versions: vec![
1643-
"3.9".to_string(),
16441643
"3.10".to_string(),
16451644
"3.11".to_string(),
16461645
"3.12".to_string(),
1646+
"3.13".to_string(),
1647+
"3.14".to_string(),
16471648
],
16481649
max_line_length: 100,
16491650
use_dependabot: true,

src/project_info.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ pub fn get_project_info(use_defaults: bool) -> Result<ProjectInfo> {
595595

596596
let python_version_default = match config.python_version {
597597
Some(python) => python,
598-
None => "3.13".to_string(),
598+
None => "3.14".to_string(),
599599
};
600600
let python_version = if use_defaults {
601601
python_version_default
@@ -619,15 +619,15 @@ pub fn get_project_info(use_defaults: bool) -> Result<ProjectInfo> {
619619
} else {
620620
match config.min_python_version {
621621
Some(python) => python,
622-
None => "3.9".to_string(),
622+
None => "3.10".to_string(),
623623
}
624624
}
625625
}
626626
#[cfg(not(feature = "fastapi"))]
627627
{
628628
match config.min_python_version {
629629
Some(python) => python,
630-
None => "3.9".to_string(),
630+
None => "3.10".to_string(),
631631
}
632632
}
633633
};
@@ -655,8 +655,8 @@ pub fn get_project_info(use_defaults: bool) -> Result<ProjectInfo> {
655655
} else {
656656
let mut versions: Vec<String> = Vec::new();
657657

658-
// Up to 3.13
659-
for i in min..14 {
658+
// Up to 3.14
659+
for i in min..15 {
660660
versions.push(format!("3.{i}"));
661661
}
662662

@@ -665,25 +665,30 @@ pub fn get_project_info(use_defaults: bool) -> Result<ProjectInfo> {
665665
} else {
666666
#[cfg(feature = "fastapi")]
667667
if is_fastapi_project {
668-
vec!["3.11".to_string(), "3.12".to_string(), "3.13".to_string()]
668+
vec![
669+
"3.11".to_string(),
670+
"3.12".to_string(),
671+
"3.13".to_string(),
672+
"3.14".to_string(),
673+
]
669674
} else {
670675
vec![
671-
"3.9".to_string(),
672676
"3.10".to_string(),
673677
"3.11".to_string(),
674678
"3.12".to_string(),
675679
"3.13".to_string(),
680+
"3.14".to_string(),
676681
]
677682
}
678683

679684
#[cfg(not(feature = "fastapi"))]
680685
{
681686
vec![
682-
"3.9".to_string(),
683687
"3.10".to_string(),
684688
"3.11".to_string(),
685689
"3.12".to_string(),
686690
"3.13".to_string(),
691+
"3.14".to_string(),
687692
]
688693
}
689694
}
@@ -1020,7 +1025,7 @@ mod tests {
10201025

10211026
#[test]
10221027
fn test_valid_two_digit_python_version() {
1023-
assert!(is_valid_python_version("3.9"));
1028+
assert!(is_valid_python_version("3.10"));
10241029
}
10251030

10261031
#[test]
@@ -1055,6 +1060,6 @@ mod tests {
10551060

10561061
#[test]
10571062
fn test_invalid_python_version_non_numeric_patch() {
1058-
assert!(!is_valid_python_version("3.9.a"));
1063+
assert!(!is_valid_python_version("3.10.a"));
10591064
}
10601065
}

src/python_files.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,16 +359,17 @@ mod tests {
359359
copyright_year: Some("2023".to_string()),
360360
version: "0.1.0".to_string(),
361361
python_version: "3.12".to_string(),
362-
min_python_version: "3.9".to_string(),
362+
min_python_version: "3.10".to_string(),
363363
project_manager: ProjectManager::Maturin,
364364
pyo3_python_manager: Some(Pyo3PythonManager::Uv),
365365
is_application: true,
366366
is_async_project: false,
367367
github_actions_python_test_versions: vec![
368-
"3.9".to_string(),
369368
"3.10".to_string(),
370369
"3.11".to_string(),
371370
"3.12".to_string(),
371+
"3.13".to_string(),
372+
"3.14".to_string(),
372373
],
373374
max_line_length: 100,
374375
use_dependabot: true,

src/rust_files.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,17 @@ mod tests {
149149
copyright_year: Some("2023".to_string()),
150150
version: "0.1.0".to_string(),
151151
python_version: "3.12".to_string(),
152-
min_python_version: "3.9".to_string(),
152+
min_python_version: "3.10".to_string(),
153153
project_manager: ProjectManager::Maturin,
154154
pyo3_python_manager: Some(Pyo3PythonManager::Uv),
155155
is_application: true,
156156
is_async_project: false,
157157
github_actions_python_test_versions: vec![
158-
"3.9".to_string(),
159158
"3.10".to_string(),
160159
"3.11".to_string(),
161160
"3.12".to_string(),
161+
"3.13".to_string(),
162+
"3.14".to_string(),
162163
],
163164
max_line_length: 100,
164165
use_dependabot: true,

src/snapshots/python_project__github_actions__tests__save_ci_testing_fastapi_file_pyo3.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
source: src/github_actions.rs
33
expression: content
44
---
5-
"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.9\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"[email protected]\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v7\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\n - name: Install uv\n uses: astral-sh/setup-uv@v7\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: uv run pytest -n auto\n"
5+
"name: Testing\n\non:\n push:\n branches:\n - main\n pull_request:\nenv:\n CARGO_TERM_COLOR: always\n RUST_BACKTRACE: 1\n RUSTFLAGS: \"-D warnings\"\n PYTHON_VERSION: \"3.10\"\n SECRET_KEY: \"someKey\"\n PRODUCTION_MODE: false\n FIRST_SUPERUSER_EMAIL: \"[email protected]\"\n FIRST_SUPERUSER_PASSWORD: \"somePassword1!\"\n FIRST_SUPERUSER_NAME: \"Super User\"\n POSTGRES_HOST: \"127.0.0.1\"\n POSTGRES_USER: \"postgres\"\n POSTGRES_PASSWORD: \"test_password\"\n POSTGRES_DB: \"test_db\"\n VALKEY_HOST: \"127.0.0.1\"\n VALKEY_PASSWORD: \"test_password\"\n MEILISEARCH_HOST: http://127.0.0.1\n STACK_NAME: \"test-stack\"\n DOMAIN: \"127.0.0.1\"\n LOG_LEVEL: \"DEBUG\"\n CI: true\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: clippy\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo clippy\n run: cargo clippy --all-targets -- --deny warnings\n fmt:\n name: Rustfmt\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n with:\n components: rustfmt\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Run cargo fmt\n run: cargo fmt --all -- --check\n python-linting:\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install uv\n uses: astral-sh/setup-uv@v7\n with:\n enable-cache: true\n - name: Set up Python\n uses: actions/setup-python@v6\n with:\n python-version: ${{ env.PYTHON_VERSION }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: Ruff format check\n run: uv run ruff format my_project tests --check\n - name: Lint with ruff\n run: uv run ruff check .\n - name: mypy check\n run: uv run mypy my_project tests\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.10\", \"3.11\", \"3.12\", \"3.13\", \"3.14\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v5\n - name: Install Rust\n uses: dtolnay/rust-toolchain@stable\n - name: Cache dependencies\n uses: Swatinem/rust-cache@v2\n - name: Install sqlx-cli\n run: cargo install sqlx-cli --no-default-features -F native-tls -F postgres\n - name: Install uv\n uses: astral-sh/setup-uv@v7\n with:\n enable-cache: true\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v6\n with:\n python-version: ${{ matrix.python-version }}\n - name: Install Dependencies\n run: |\n uv sync --frozen\n uv run maturin build\n - name: make .env\n run: touch .env\n - name: Start docker containers\n run: docker compose up db valkey migrations -d\n - name: Test with pytest\n run: uv run pytest -n auto\n"

0 commit comments

Comments
 (0)