Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 07 Jun 2022 06:55:04
Message-Id: 1654584838.2168e72d746d34f8babed2e2f57b310742f36bc1.mgorny@gentoo
1 commit: 2168e72d746d34f8babed2e2f57b310742f36bc1
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 6 10:18:01 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 7 06:53:58 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2168e72d
7
8 distutils-r1.eclass: Warn about setuptools legacy backend
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 eclass/distutils-r1.eclass | 8 +++++++-
13 1 file changed, 7 insertions(+), 1 deletion(-)
14
15 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
16 index db46d64eea4a..5fb97b35fed3 100644
17 --- a/eclass/distutils-r1.eclass
18 +++ b/eclass/distutils-r1.eclass
19 @@ -1166,7 +1166,7 @@ _distutils-r1_backend_to_key() {
20 _distutils-r1_get_backend() {
21 debug-print-function ${FUNCNAME} "${@}"
22
23 - local build_backend
24 + local build_backend legacy_fallback
25 if [[ -f pyproject.toml ]]; then
26 # if pyproject.toml exists, try getting the backend from it
27 # NB: this could fail if pyproject.toml doesn't list one
28 @@ -1177,6 +1177,7 @@ _distutils-r1_get_backend() {
29 then
30 # use the legacy setuptools backend as a fallback
31 build_backend=setuptools.build_meta:__legacy__
32 + legacy_fallback=1
33 fi
34 if [[ -z ${build_backend} ]]; then
35 die "Unable to obtain build-backend from pyproject.toml"
36 @@ -1202,6 +1203,11 @@ _distutils-r1_get_backend() {
37 poetry.masonry.api)
38 new_backend=poetry.core.masonry.api
39 ;;
40 + setuptools.build_meta:__legacy__)
41 + # this backend should only be used as implicit fallback
42 + [[ ! ${legacy_fallback} ]] &&
43 + new_backend=setuptools.build_meta
44 + ;;
45 esac
46
47 if [[ -n ${new_backend} ]]; then