From 571de0c704f21fa67fb4f60b15deb88ee8e5e94b Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Fri, 25 Oct 2024 23:42:55 +0100 Subject: [PATCH] Add support for PEP 735 dependency-groups https://peps.python.org/pep-0735/ --- pyproject-fmt/rust/src/global.rs | 1 + pyproject-fmt/rust/src/tests/global_tests.rs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/pyproject-fmt/rust/src/global.rs b/pyproject-fmt/rust/src/global.rs index 8ffa1e4..e73041c 100644 --- a/pyproject-fmt/rust/src/global.rs +++ b/pyproject-fmt/rust/src/global.rs @@ -10,6 +10,7 @@ pub fn reorder_tables(root_ast: &SyntaxNode, tables: &Tables) { "", "build-system", "project", + "dependency-groups", // Build backends "tool.poetry", "tool.poetry-dynamic-versioning", diff --git a/pyproject-fmt/rust/src/tests/global_tests.rs b/pyproject-fmt/rust/src/tests/global_tests.rs index f9a84ca..4a8ee6c 100644 --- a/pyproject-fmt/rust/src/tests/global_tests.rs +++ b/pyproject-fmt/rust/src/tests/global_tests.rs @@ -17,6 +17,9 @@ use common::table::Tables; [build-system] build-backend="backend" requires=["c", "d"] + [dependency-groups] + docs=["s"] + test=["p", "q"] [tool.mypy] mk="mv" [tool.ruff.test] @@ -57,6 +60,15 @@ use common::table::Tables; "e", ] + [dependency-groups] + docs = [ + "s", + ] + test = [ + "p", + "q", + ] + [tool.ruff] mr = "vr" [tool.ruff.test]