From da19f9acdd2d127c20018a0eca9f39f3a0620205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Thu, 10 Oct 2024 12:46:03 -0700 Subject: [PATCH] Drop 3.8 support (#59) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernát Gábor --- .github/workflows/check.yaml | 1 - Cargo.lock | 2 +- Cargo.toml | 2 +- pyproject.toml | 3 +- rust/src/main.rs | 30 +++++++------- rust/src/project.rs | 79 ++++++++++++++++++------------------ tox.ini | 1 - 7 files changed, 57 insertions(+), 61 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 46ad71a..2bc8bf2 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -21,7 +21,6 @@ jobs: - "3.11" - "3.10" - "3.9" - - "3.8" os: - ubuntu-latest - windows-latest diff --git a/Cargo.lock b/Cargo.lock index 0751782..155ae8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -520,7 +520,7 @@ dependencies = [ [[package]] name = "pyproject-fmt-rust" -version = "1.1.6" +version = "1.2.0" dependencies = [ "indoc", "lexical-sort", diff --git a/Cargo.toml b/Cargo.toml index f7b76d7..a03d341 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyproject-fmt-rust" -version = "1.1.6" +version = "1.2.0" description = "Format pyproject.toml files" repository = "https://github.com/tox-dev/pyproject-fmt" readme = "README.md" diff --git a/pyproject.toml b/pyproject.toml index 32c5bee..b15230e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,13 +16,12 @@ license.file = "LICENSE.txt" authors = [ { name = "Bernat Gabor", email = "gaborjbernat@gmail.com" }, ] -requires-python = ">=3.8" +requires-python = ">=3.9" classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/rust/src/main.rs b/rust/src/main.rs index 5abda5f..aeb8993 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -137,11 +137,11 @@ mod tests { name = "alpha" classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [ "e>=1.5", @@ -152,14 +152,14 @@ mod tests { "#}, 2, false, - (3, 12), + (3, 13), )] #[case::empty( indoc ! {r""}, "\n", 2, true, - (3, 12) + (3, 13) )] #[case::scripts( indoc ! {r#" @@ -171,14 +171,14 @@ mod tests { [project] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] scripts.a = "b" scripts.c = "d" "#}, 2, true, - (3, 8) + (3, 9) )] #[case::subsubtable( indoc ! {r" @@ -196,7 +196,7 @@ mod tests { [project] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] [tool.coverage] @@ -210,7 +210,7 @@ mod tests { "#}, 2, true, - (3, 8) + (3, 9) )] #[case::array_of_tables( indoc ! {r#" @@ -240,7 +240,7 @@ mod tests { "#}, 2, true, - (3, 8) + (3, 9) )] #[case::unstable_issue_18( indoc ! {r#" @@ -270,7 +270,7 @@ mod tests { "#}, 2, true, - (3, 8) + (3, 9) )] fn test_format_toml( #[case] start: &str, @@ -284,7 +284,7 @@ mod tests { indent, keep_full_version, max_supported_python, - min_supported_python: (3, 8), + min_supported_python: (3, 9), }; let got = format_toml(start, &settings); assert_eq!(got, expected); @@ -307,8 +307,8 @@ mod tests { column_width: 1, indent: 2, keep_full_version: false, - max_supported_python: (3, 8), - min_supported_python: (3, 8), + max_supported_python: (3, 9), + min_supported_python: (3, 9), }; let got = format_toml(start.as_str(), &settings); let expected = read_to_string(data.join("ruff-order.expected.toml")).unwrap(); @@ -336,8 +336,8 @@ mod tests { column_width: 80, indent: 4, keep_full_version: false, - max_supported_python: (3, 12), - min_supported_python: (3, 12), + max_supported_python: (3, 13), + min_supported_python: (3, 13), }; let got = format_toml(start, &settings); let expected = indoc! {r#" @@ -349,7 +349,7 @@ mod tests { name = "beta" classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] dependencies = [ "e>=1.5", diff --git a/rust/src/project.rs b/rust/src/project.rs index b5015dc..7d73e1b 100644 --- a/rust/src/project.rs +++ b/rust/src/project.rs @@ -381,7 +381,7 @@ mod tests { let root_ast = parse(start).into_syntax().clone_for_update(); let count = root_ast.children_with_tokens().count(); let mut tables = Tables::from_ast(&root_ast); - fix(&mut tables, keep_full_version, max_supported_python, (3, 8)); + fix(&mut tables, keep_full_version, max_supported_python, (3, 9)); let entries = tables .table_set .iter() @@ -400,7 +400,7 @@ mod tests { indoc ! {r""}, "\n", false, - (3, 8), + (3, 9), )] #[case::project_requires_no_keep( indoc ! {r#" @@ -411,7 +411,7 @@ mod tests { [project] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] dependencies = [ "a>=1", @@ -419,7 +419,7 @@ mod tests { ] "#}, false, - (3, 8), + (3, 9), )] #[case::project_requires_keep( indoc ! {r#" @@ -430,7 +430,7 @@ mod tests { [project] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] dependencies = [ "a>=1.0.0", @@ -438,12 +438,12 @@ mod tests { ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_requires_ge( indoc ! {r#" [project] - requires-python = " >= 3.8" + requires-python = " >= 3.9" classifiers = [ # comment license inline 1 # comment license inline 2 @@ -460,13 +460,12 @@ mod tests { "#}, indoc ! {r#" [project] - requires-python = ">=3.8" + requires-python = ">=3.9" classifiers = [ # comment license inline 1 # comment license inline 2 "License :: OSI Approved :: MIT License", # comment license post "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", # comment 3.10 inline "Programming Language :: Python :: 3.10", # comment 3.10 post @@ -481,18 +480,18 @@ mod tests { #[case::project_requires_gt( indoc ! {r#" [project] - requires-python = " > 3.7" + requires-python = " > 3.8" "#}, indoc ! {r#" [project] - requires-python = ">3.7" + requires-python = ">3.8" classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_requires_eq( indoc ! {r#" @@ -508,7 +507,7 @@ mod tests { ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_sort_keywords( indoc ! {r#" @@ -525,11 +524,11 @@ mod tests { ] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_sort_dynamic( indoc ! {r#" @@ -540,7 +539,7 @@ mod tests { [project] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] dynamic = [ " c", @@ -552,7 +551,7 @@ mod tests { ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_name_norm( indoc ! {r#" @@ -564,11 +563,11 @@ mod tests { name = "a-b-c" classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_name_literal( indoc ! {r" @@ -580,28 +579,28 @@ mod tests { name = "a-b-c" classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_requires_gt_old( indoc ! {r#" [project] - requires-python = " > 3.6" + requires-python = " > 3.7" "#}, indoc ! {r#" [project] - requires-python = ">3.6" + requires-python = ">3.7" classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_requires_range( indoc ! {r#" @@ -622,7 +621,7 @@ mod tests { ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_requires_high_range( indoc ! {r#" @@ -640,7 +639,7 @@ mod tests { ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_requires_range_neq( indoc ! {r#" @@ -657,7 +656,7 @@ mod tests { ] "#}, true, - (3, 12), + (3, 13), )] #[case::project_description_whitespace( "[project]\ndescription = ' A magic stuff \t is great\t\t.\r\n Like really .\t\'\nrequires-python = '==3.12'", @@ -671,7 +670,7 @@ mod tests { ] "#}, true, - (3, 12), + (3, 13), )] #[case::project_description_multiline( indoc ! {r#" @@ -692,7 +691,7 @@ mod tests { ] "#}, true, - (3, 12), + (3, 13), )] #[case::project_dependencies_with_double_quotes( indoc ! {r#" @@ -716,7 +715,7 @@ mod tests { ] "#}, true, - (3, 12), + (3, 13), )] #[case::project_platform_dependencies( indoc ! {r#" @@ -742,7 +741,7 @@ mod tests { ] "#}, true, - (3, 12), + (3, 13), )] #[case::project_opt_inline_dependencies( indoc ! {r#" @@ -772,7 +771,7 @@ mod tests { ] "#}, true, - (3, 12), + (3, 13), )] #[case::project_opt_dependencies( indoc ! {r#" @@ -784,7 +783,7 @@ mod tests { [project] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] optional-dependencies.docs = [ "sphinx>=7.3.7", @@ -796,7 +795,7 @@ mod tests { ] "#}, true, - (3, 8), + (3, 9), )] #[case::project_scripts_collapse( indoc ! {r#" @@ -808,13 +807,13 @@ mod tests { [project] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] scripts.a = "b" scripts.c = "d" "#}, true, - (3, 8), + (3, 9), )] #[case::project_entry_points_collapse( indoc ! {r#" @@ -838,7 +837,7 @@ mod tests { [project] classifiers = [ "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", ] scripts.virtualenv = "virtualenv.__main__:run_with_catch" gui-scripts.hello-world = "timmins:hello_world" @@ -851,7 +850,7 @@ mod tests { entry-points."virtualenv.activate".bash = "virtualenv.activation.bash:BashActivator" "#}, true, - (3, 8), + (3, 9), )] #[case::project_preserve_implementation_classifiers( indoc ! {r#" diff --git a/tox.ini b/tox.ini index f12b4ad..652fe13 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,6 @@ env_list = 3.11 3.10 3.9 - 3.8 type pkg_meta