[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] [PATCH 2/6] distutils-r1.eclass: make esetup.py require setup.{py,cfg}
From:       Michał Górny <mgorny () gentoo ! org>
Date:       2022-01-31 22:59:16
Message-ID: 20220131225920.192125-3-mgorny () gentoo ! org
[Download RAW message or body]

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@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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic