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 1/4] distutils-r1.eclass: Remove obsolete DUS=pyproject.toml support
Date: Sun, 02 Oct 2022 16:18:53
Message-Id: 20221002161840.5552-1-mgorny@gentoo.org
1 Remove the obsolete code branches for DISTUTILS_USE_SETUPTOOLS
2 pyproject.toml variant. dev-python/pyproject2setuppy is last rited now
3 and there are no consumers of that mode left in ::gentoo.
4
5 Signed-off-by: Michał Górny <mgorny@g.o>
6 ---
7 eclass/distutils-r1.eclass | 19 ++++++-------------
8 1 file changed, 6 insertions(+), 13 deletions(-)
9
10 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
11 index 60f81473c0a6..d011e5f97ad9 100644
12 --- a/eclass/distutils-r1.eclass
13 +++ b/eclass/distutils-r1.eclass
14 @@ -150,9 +150,6 @@ esac
15 #
16 # - rdepend -- add it to BDEPEND+RDEPEND (e.g. when using pkg_resources)
17 #
18 -# - pyproject.toml -- use pyproject2setuptools to install a project
19 -# using pyproject.toml (flit, poetry...)
20 -#
21 # - manual -- do not add the dependency and suppress the checks
22 # (assumes you will take care of doing it correctly)
23 #
24 @@ -293,7 +290,7 @@ _distutils_set_globals() {
25 rdep+=" ${setuptools_dep}"
26 ;;
27 pyproject.toml)
28 - bdep+=' >=dev-python/pyproject2setuppy-22[${PYTHON_USEDEP}]'
29 + die "DISTUTILS_USE_SETUPTOOLS=pyproject.toml is no longer supported, use DISTUTILS_USE_PEP517"
30 ;;
31 *)
32 die "Invalid DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}"
33 @@ -668,9 +665,7 @@ esetup.py() {
34 fi
35
36 local setup_py=( setup.py )
37 - if [[ ${DISTUTILS_USE_SETUPTOOLS} == pyproject.toml ]]; then
38 - setup_py=( -m pyproject2setuppy )
39 - elif [[ ! -f setup.py ]]; then
40 + if [[ ! -f setup.py ]]; then
41 if [[ ! -f setup.cfg ]]; then
42 die "${FUNCNAME}: setup.py nor setup.cfg not found"
43 fi
44 @@ -883,12 +878,10 @@ _distutils-r1_handle_pyproject_toml() {
45 [[ ${DISTUTILS_USE_SETUPTOOLS} == manual ]] && return
46
47 if [[ ! -f setup.py && -f pyproject.toml ]]; then
48 - if [[ ${DISTUTILS_USE_SETUPTOOLS} != pyproject.toml ]]; then
49 - eerror "No setup.py found but pyproject.toml is present. Please migrate"
50 - eerror "the package to use DISTUTILS_USE_PEP517. See:"
51 - eerror " https://projects.gentoo.org/python/guide/distutils.html"
52 - die "No setup.py found and PEP517 mode not enabled"
53 - fi
54 + eerror "No setup.py found but pyproject.toml is present. Please migrate"
55 + eerror "the package to use DISTUTILS_USE_PEP517. See:"
56 + eerror " https://projects.gentoo.org/python/guide/distutils.html"
57 + die "No setup.py found and PEP517 mode not enabled"
58 fi
59 }
60
61 --
62 2.37.3

Replies