Make esetup.py fail if neither setup.py nor setup.cfg is available.
To support PEP 517 builds, the function has been modified to work
without setup.py.  However, this also caused esetup.py to implicitly
succeed in installing zero files on non-distutils/setuptools packages.

Signed-off-by: Michał Górny <mgo...@gentoo.org>
---
 eclass/distutils-r1.eclass | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 4ec252958408..a81d95f4eb6e 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -544,6 +544,9 @@ esetup.py() {
        if [[ ${DISTUTILS_USE_SETUPTOOLS} == pyproject.toml ]]; then
                setup_py=( -m pyproject2setuppy )
        elif [[ ! -f setup.py ]]; then
+               if [[ ! -f setup.cfg ]]; then
+                       die "${FUNCNAME}: setup.py nor setup.cfg not found"
+               fi
                setup_py=( -c "from setuptools import setup; setup()" )
        fi
 
-- 
2.35.1


Reply via email to