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, 01 Feb 2022 18:33:45
Message-Id: 1643740397.60ef204725e4c667efd95a2b8742180345f347ca.mgorny@gentoo
1 commit: 60ef204725e4c667efd95a2b8742180345f347ca
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 30 11:12:02 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 1 18:33:17 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60ef2047
7
8 distutils-r1.eclass: make esetup.py require setup.{py,cfg}
9
10 Make esetup.py fail if neither setup.py nor setup.cfg is available.
11 To support PEP 517 builds, the function has been modified to work
12 without setup.py. However, this also caused esetup.py to implicitly
13 succeed in installing zero files on non-distutils/setuptools packages.
14
15 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
16
17 eclass/distutils-r1.eclass | 3 +++
18 1 file changed, 3 insertions(+)
19
20 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
21 index 4ec252958408..a81d95f4eb6e 100644
22 --- a/eclass/distutils-r1.eclass
23 +++ b/eclass/distutils-r1.eclass
24 @@ -544,6 +544,9 @@ esetup.py() {
25 if [[ ${DISTUTILS_USE_SETUPTOOLS} == pyproject.toml ]]; then
26 setup_py=( -m pyproject2setuppy )
27 elif [[ ! -f setup.py ]]; then
28 + if [[ ! -f setup.cfg ]]; then
29 + die "${FUNCNAME}: setup.py nor setup.cfg not found"
30 + fi
31 setup_py=( -c "from setuptools import setup; setup()" )
32 fi