Gentoo Archives: gentoo-python

From: "Michał Górny" <mgorny@g.o>
To: gentoo-python@l.g.o
Cc: python@g.o
Subject: [gentoo-python] [PATCHES] Cleaning python_foreach_impl() up and introduce a parallel variant
Date: Thu, 21 Feb 2013 22:07:17
Message-Id: 20130221230724.15b66f86@pomiocik.lan
1 Hello,
2
3 I'm sending a batch of patches (git-kind of replies to this mail).
4 The patches do the following:
5
6
7 1) clean up failure handling in python_foreach_impl().
8
9 Currently, python_foreach_impl supposedly dies if one of the functions
10 returns failure. This is quite unnecessary since most of the functions
11 called there are supposed to be fatal themselves, and may be a bit
12 confusing.
13
14 The idea is that:
15
16 python_foreach_impl foo
17
18 should be as close to:
19
20 for x in ...; do foo; done
21
22 as possible. The implicit '|| die' doesn't really look helpful since it
23 may hurt people with small unimportant conditionals at the end of their
24 functions, and may cause a few others to actually rely
25 on python_foreach_impl handling failures for them.
26
27 Therefore, the function is not fatal anymore. Instead, it just returns
28 0 for complete success or status of first failure. In any case,
29 the thingie called should 'die' on itself.
30
31
32 2) introduce a parallel variant of python_foreach_impl().
33
34 Based on the code from distutils-r1. For that reason and compatibility,
35 the variable controlling no of jobs is still being called
36 'DISTUTILS_JOBS'.
37
38 The new function is also used in distutils-r1, with the two last
39 patches doing pre-merge cleanup and actually using it.
40
41
42 3) move split log handling into python*_foreach_impl().
43
44 With the parallel build feature no longer being distutils-specific,
45 the split logs shall be accessible outside of it. Therefore, I have
46 moved their support completely to python*_foreach_impl() functions.
47
48
49 --
50 Best regards,
51 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies