commit:     60ef204725e4c667efd95a2b8742180345f347ca
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 30 11:12:02 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Feb  1 18:33:17 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60ef2047

distutils-r1.eclass: make esetup.py require setup.{py,cfg}

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 <mgorny <AT> 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
 

Reply via email to