From 9efd70e0eee7d29728d8a88ac4f8f5d08260dd28 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Nov 12 2024 22:02:52 +0000 Subject: [PATCH 1/2] Python: %pyproject_buildrequires: Document support for PEP 735 (dependency groups) --- diff --git a/guidelines/modules/ROOT/pages/Python.adoc b/guidelines/modules/ROOT/pages/Python.adoc index 5ba0c56..4f2a721 100644 --- a/guidelines/modules/ROOT/pages/Python.adoc +++ b/guidelines/modules/ROOT/pages/Python.adoc @@ -1125,12 +1125,15 @@ is using an <> like `+[test]+`, `+[testing]+` or `+[dev]+`. In this case, upstream’s instructions to install test dependencies might look like `+$ pip install -e.[test]+`. +Another way to specify test dependencies is using a dedicated dependency group +(https://www.python.org/dev/peps/pep-0735/[PEP 735]). + Projects using `+tox+` usually specify test dependencies in a `+tox+`-specific format: a https://tox.readthedocs.io/en/latest/config.html#conf-requires[requires] key in the configuration. -These two forms are handled by +These three forms are handled by the <>. If upstream does not use either form, @@ -1144,7 +1147,7 @@ BuildRequires: python3dist(pytest) ---- If you need to do this, -consider asking upstream to add a `+[test]+` extra. +consider asking upstream to add a `+[test]+` extra or a `test` dependency group. === Linters @@ -1324,7 +1327,7 @@ Summary: %{summary} %generate_buildrequires -%pyproject_buildrequires -x... / -t +%pyproject_buildrequires -x... / -g... / -t %build @@ -1480,6 +1483,8 @@ The macro has these options: run-time requirements are included by default). ** `+-x EXTRA+`: Include dependencies given by the given <>. Cannot be used with `+-R+`. +** `+-g GROUP+`: Include dependencies specified in the given dependency group +(https://www.python.org/dev/peps/pep-0735/[PEP 735]). ** `+-p`: Read run-time dependencies from pyproject.toml [project] table. This reads also the [optional-dependencies] for the given <>. Cannot be used with `+-R+`. From a2fc7c91b59a20f0729b52d41ddc327a92dd350c Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Nov 12 2024 22:02:52 +0000 Subject: [PATCH 2/2] Python: Fix a syntax typo --- diff --git a/guidelines/modules/ROOT/pages/Python.adoc b/guidelines/modules/ROOT/pages/Python.adoc index 4f2a721..27cacb6 100644 --- a/guidelines/modules/ROOT/pages/Python.adoc +++ b/guidelines/modules/ROOT/pages/Python.adoc @@ -1485,7 +1485,7 @@ run-time requirements are included by default). Cannot be used with `+-R+`. ** `+-g GROUP+`: Include dependencies specified in the given dependency group (https://www.python.org/dev/peps/pep-0735/[PEP 735]). -** `+-p`: Read run-time dependencies from pyproject.toml [project] table. +** `+-p+`: Read run-time dependencies from pyproject.toml [project] table. This reads also the [optional-dependencies] for the given <>. Cannot be used with `+-R+`. ** `+-t+`: Include dependencies for the default _tox_ environment.