Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/6] distutils-r1.eclass: make esetup.py require setup.{py,cfg}
Date: Mon, 31 Jan 2022 23:00:08
Message-Id: 20220131225920.192125-3-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/6] Another batch of distutils-r1.eclass fixes by "Michał Górny"
1 Make esetup.py fail if neither setup.py nor setup.cfg is available.
2 To support PEP 517 builds, the function has been modified to work
3 without setup.py. However, this also caused esetup.py to implicitly
4 succeed in installing zero files on non-distutils/setuptools packages.
5
6 Signed-off-by: Michał Górny <mgorny@g.o>
7 ---
8 eclass/distutils-r1.eclass | 3 +++
9 1 file changed, 3 insertions(+)
10
11 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
12 index 4ec252958408..a81d95f4eb6e 100644
13 --- a/eclass/distutils-r1.eclass
14 +++ b/eclass/distutils-r1.eclass
15 @@ -544,6 +544,9 @@ esetup.py() {
16 if [[ ${DISTUTILS_USE_SETUPTOOLS} == pyproject.toml ]]; then
17 setup_py=( -m pyproject2setuppy )
18 elif [[ ! -f setup.py ]]; then
19 + if [[ ! -f setup.cfg ]]; then
20 + die "${FUNCNAME}: setup.py nor setup.cfg not found"
21 + fi
22 setup_py=( -c "from setuptools import setup; setup()" )
23 fi
24
25 --
26 2.35.1