Skip to content

Commit 9cfd378

Browse files
authored
Make Python 3.9 the default minimum version (#396)
* Make Python 3.9 the default minimum version * Bump min python to 3.9 in ci
1 parent c69a15a commit 9cfd378

File tree

25 files changed

+27
-34
lines changed

25 files changed

+27
-34
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.8"
13+
MIN_PYTHON_VERSION: "3.9"
1414
CI: true # For insta
1515
jobs:
1616
clippy:

src/github_actions.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -905,11 +905,10 @@ mod tests {
905905
copyright_year: Some("2023".to_string()),
906906
version: "0.1.0".to_string(),
907907
python_version: "3.12".to_string(),
908-
min_python_version: "3.8".to_string(),
908+
min_python_version: "3.9".to_string(),
909909
project_manager: ProjectManager::Maturin,
910910
is_application: true,
911911
github_actions_python_test_versions: vec![
912-
"3.8".to_string(),
913912
"3.9".to_string(),
914913
"3.10".to_string(),
915914
"3.11".to_string(),
@@ -931,13 +930,12 @@ mod tests {
931930
fn test_build_github_actions_test_versions() {
932931
assert_eq!(
933932
build_actions_python_test_versions(&[
934-
"3.8".to_string(),
935933
"3.9".to_string(),
936934
"3.10".to_string(),
937935
"3.11".to_string(),
938936
"3.12".to_string(),
939937
]),
940-
r#""3.8", "3.9", "3.10", "3.11", "3.12""#.to_string()
938+
r#""3.9", "3.10", "3.11", "3.12""#.to_string()
941939
);
942940
}
943941

src/licenses.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,10 @@ mod tests {
270270
copyright_year: Some("2023".to_string()),
271271
version: "0.1.0".to_string(),
272272
python_version: "3.11".to_string(),
273-
min_python_version: "3.8".to_string(),
273+
min_python_version: "3.9".to_string(),
274274
project_manager: ProjectManager::Poetry,
275275
is_application: true,
276276
github_actions_python_test_versions: vec![
277-
"3.8".to_string(),
278277
"3.9".to_string(),
279278
"3.10".to_string(),
280279
"3.11".to_string(),

src/main.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,10 @@ mod tests {
276276
copyright_year: Some("2023".to_string()),
277277
version: "0.1.0".to_string(),
278278
python_version: "3.12".to_string(),
279-
min_python_version: "3.8".to_string(),
279+
min_python_version: "3.9".to_string(),
280280
project_manager: ProjectManager::Poetry,
281281
is_application: true,
282282
github_actions_python_test_versions: vec![
283-
"3.8".to_string(),
284283
"3.9".to_string(),
285284
"3.10".to_string(),
286285
"3.11".to_string(),

src/project_generator.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -651,14 +651,14 @@ mod tests {
651651
copyright_year: Some("2023".to_string()),
652652
version: "0.1.7".to_string(),
653653
python_version: "3.11".to_string(),
654-
min_python_version: "3.8".to_string(),
654+
min_python_version: "3.9".to_string(),
655655
project_manager: ProjectManager::Poetry,
656656
is_application: true,
657657
github_actions_python_test_versions: vec![
658-
"3.8".to_string(),
659658
"3.9".to_string(),
660659
"3.10".to_string(),
661660
"3.11".to_string(),
661+
"3.12".to_string(),
662662
],
663663
max_line_length: 100,
664664
use_dependabot: true,

src/project_info.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ pub fn get_project_info(use_defaults: bool) -> Result<ProjectInfo> {
467467

468468
let min_python_version_default = match config.min_python_version {
469469
Some(python) => python,
470-
None => "3.8".to_string(),
470+
None => "3.9".to_string(),
471471
};
472472
let min_python_version = if use_defaults {
473473
min_python_version_default
@@ -496,7 +496,6 @@ pub fn get_project_info(use_defaults: bool) -> Result<ProjectInfo> {
496496
}
497497
} else {
498498
vec![
499-
"3.8".to_string(),
500499
"3.9".to_string(),
501500
"3.10".to_string(),
502501
"3.11".to_string(),

src/python_files.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,10 @@ mod tests {
312312
copyright_year: Some("2023".to_string()),
313313
version: "0.1.0".to_string(),
314314
python_version: "3.12".to_string(),
315-
min_python_version: "3.8".to_string(),
315+
min_python_version: "3.9".to_string(),
316316
project_manager: ProjectManager::Maturin,
317317
is_application: true,
318318
github_actions_python_test_versions: vec![
319-
"3.8".to_string(),
320319
"3.9".to_string(),
321320
"3.10".to_string(),
322321
"3.11".to_string(),

src/rust_files.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,10 @@ mod tests {
145145
copyright_year: Some("2023".to_string()),
146146
version: "0.1.0".to_string(),
147147
python_version: "3.12".to_string(),
148-
min_python_version: "3.8".to_string(),
148+
min_python_version: "3.9".to_string(),
149149
project_manager: ProjectManager::Maturin,
150150
is_application: true,
151151
github_actions_python_test_versions: vec![
152-
"3.8".to_string(),
153152
"3.9".to_string(),
154153
"3.10".to_string(),
155154
"3.11".to_string(),

src/snapshots/python_project__github_actions__tests__save_ci_testing_linux_only_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\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/[email protected]\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@v4\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/[email protected]\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@v4\n - name: Set up Python\n uses: actions/setup-python@v5\n with:\n python-version: \"3.8\"\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n python -m pip install -e .\n maturin build --out dist\n python -m pip install --no-index --find-links=dist/ prelude-parser\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy .\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v5\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n python -m pip install -e .\n maturin build --out dist\n python -m pip install --no-index --find-links=dist/ prelude-parser\n - name: Test with pytest\n run: pytest\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\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/[email protected]\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@v4\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/[email protected]\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@v4\n - name: Set up Python\n uses: actions/setup-python@v5\n with:\n python-version: \"3.9\"\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n python -m pip install -e .\n maturin build --out dist\n python -m pip install --no-index --find-links=dist/ prelude-parser\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy .\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@v4\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v5\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n python -m pip install -e .\n maturin build --out dist\n python -m pip install --no-index --find-links=dist/ prelude-parser\n - name: Test with pytest\n run: pytest\n"

src/snapshots/python_project__github_actions__tests__save_ci_testing_multi_os_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\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/[email protected]\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@v4\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/[email protected]\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@v4\n - name: Set up Python\n uses: actions/setup-python@v5\n with:\n python-version: \"3.8\"\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n python -m pip install -e .\n maturin build --out dist\n python -m pip install --no-index --find-links=dist/ prelude-parser\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy .\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.8\", \"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v4\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v5\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n python -m pip install -e .\n maturin build --out dist\n python -m pip install --no-index --find-links=dist/ prelude-parser\n - name: Test with pytest\n run: pytest\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\"\njobs:\n clippy:\n name: Clippy\n runs-on: ubuntu-latest\n steps:\n - uses: actions/checkout@v4\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/[email protected]\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@v4\n - name: Install Rust\n run: |\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y\n - name: Cache dependencies\n uses: Swatinem/[email protected]\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@v4\n - name: Set up Python\n uses: actions/setup-python@v5\n with:\n python-version: \"3.9\"\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n python -m pip install -e .\n maturin build --out dist\n python -m pip install --no-index --find-links=dist/ prelude-parser\n - name: Ruff format check\n run: ruff format my_project tests --check\n - name: Lint with ruff\n run: ruff check .\n - name: mypy check\n run: mypy .\n testing:\n strategy:\n fail-fast: false\n matrix:\n python-version: [\"3.9\", \"3.10\", \"3.11\", \"3.12\"]\n os: [ubuntu-latest, windows-latest, macos-latest]\n runs-on: ${{ matrix.os }}\n steps:\n - uses: actions/checkout@v4\n - name: Set up Python ${{ matrix.python-version }}\n uses: actions/setup-python@v5\n with:\n python-version: ${{ matrix.python-version }}\n cache: \"pip\"\n - name: Install Dependencies\n run: |\n python -m pip install -U pip\n python -m pip install -r requirements-dev.txt\n python -m pip install -e .\n maturin build --out dist\n python -m pip install --no-index --find-links=dist/ prelude-parser\n - name: Test with pytest\n run: pytest\n"

0 commit comments

Comments
 (0)