From acd36770c8390cad9d7356c4bd08ec352e501539 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Aug 15 2024 16:50:45 +0000 Subject: Do not require literal `BuildRequires: python3-devel` in the specfile When this rule was introduced, using `BuildRequires: python3-devel` was the way to: - pull python3-rpm-macros, - pull python3-rpm-generators, - pull pyproject-rpm-macros, - actually BuildRequire python3-devel. Later, it become possible to use this to achieve the same goals: %generate_buildrequires %pyproject_buildrequires This generates the same dependency and can be used out-of-the-box thanks to pyproject-srpm-macros. When this feature was introduced, I decided to keep the rule, because I wanted to encourage people to explicitly keep `BuildRequires: python3-devel`. However, this requirement makes the use of the RPM pyproject declarative buildsystem a bit cumbersome. See https://src.fedoraproject.org/rpms/pyproject-rpm-macros/pull-request/455 and https://rpm-software-management.github.io/rpm/manual/buildsystem.html If the specfile has: BuildSystem: pyproject We don't also need: BuildRequires: python3-devel The declarative buildsystem is not explicitly mentioned here, as it is a provisional feature. --- diff --git a/guidelines/modules/ROOT/pages/Python.adoc b/guidelines/modules/ROOT/pages/Python.adoc index f8b1774..cce0a8c 100644 --- a/guidelines/modules/ROOT/pages/Python.adoc +++ b/guidelines/modules/ROOT/pages/Python.adoc @@ -104,9 +104,11 @@ if you need help or wish to help out. *Every* package that uses Python (at runtime and/or build time) and/or installs Python modules -*MUST* explicitly include `+BuildRequires: python3-devel+` -in its `+.spec+` file, +*MUST* explicitly BuildRequire `+python3-devel+`, even if Python is not actually invoked during build time. +Such package *MUST* include `+BuildRequires: python3-devel+` in its `+.spec+` file +or use <> +in the `+%generate_buildrequires+` section. If the package uses an alternate Python interpreter instead of `+python3+` (e.g. `+pypy+`, `+jython+`, `+python2.7+`),