Gentoo Archives: gentoo-dev

From: Alexey Sokolov <alexey+gentoo@××××××××.org>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH 1/2] distutils-r1.eclass: Prefer "rm -rf build" over "setup.py clean -a"
Date: Sun, 17 Apr 2022 10:42:53
Message-Id: ebda98dd-f1b3-3854-e136-9d747ee4ff17@asokolov.org
In Reply to: [gentoo-dev] [PATCH 1/2] distutils-r1.eclass: Prefer "rm -rf build" over "setup.py clean -a" by "Michał Górny"
1 09.04.2022 17:37, Michał Górny пишет:
2 > Prefer using "rm -rf build" directly over "setup.py clean -a". This
3 > has three advantages:
4 >
5 > 1. It is much faster.
6 >
7 > 2. It works on packages that have broken "setup.py clean",
8 > e.g. dev-python/pydantic.
9 >
10 > 3. It works on packages that block "setup.py clean" and tell you to use
11 > "git clean" (sic!), e.g. dev-python/scipy.
12 >
13 > This is a potentially (but unlikely) breaking change, so do it
14 > conditionally to GPEP517_TESTING.
15 >
16 > Signed-off-by: Michał Górny <mgorny@g.o>
17 > ---
18 > eclass/distutils-r1.eclass | 6 +++++-
19 > 1 file changed, 5 insertions(+), 1 deletion(-)
20 >
21 > diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
22 > index de891215e688..e6b0ab5e0e32 100644
23 > --- a/eclass/distutils-r1.eclass
24 > +++ b/eclass/distutils-r1.eclass
25 > @@ -1090,7 +1090,11 @@ distutils_pep517_install() {
26 > # clean the build tree; otherwise we may end up with PyPy3
27 > # extensions duplicated into CPython dists
28 > if [[ ${DISTUTILS_USE_PEP517:-setuptools} == setuptools ]]; then
29 > - esetup.py clean -a
30 > + if [[ ${GPEP517_TESTING} ]]; then
31 > + rm -rf build || die
32 > + else
33 > + esetup.py clean -a
34 > + fi
35 > fi
36 > }
37 >
38
39 rm -r build || die
40
41 -f makes it not fail, which makes ||die useless
42
43 --
44 Best regards,
45 Alexey "DarthGandalf" Sokolov

Replies