1 |
Hi, |
2 |
|
3 |
I'm submitting a batch of patches for python-any-r1. The patches: |
4 |
|
5 |
1. improve consistency between Python impl checking code. All branches |
6 |
start to check whether Python interpreter is installed. |
7 |
|
8 |
2. improve consistency in wrapper setup. All branches now set up |
9 |
wrappers. |
10 |
|
11 |
3. error out if no Python impl matches. This will become important with |
12 |
the new dep-check function. |
13 |
|
14 |
4. add support for defining python_check_deps() function in ebuilds. |
15 |
The function can be used to verify whether Python impl chosen by eclass |
16 |
supports all the deps needed for the package. |
17 |
|
18 |
For example, if a package runs a script needing dev-python/foo |
19 |
and dev-python/bar, the function would look like: |
20 |
|
21 |
python_check_deps() { |
22 |
if ! has_version "dev-python/foo[${PYTHON_USEDEP}]"; then |
23 |
einfo "${EPYTHON}: dev-python/foo does not support the impl" |
24 |
return 1 |
25 |
elif ! has_version "dev-python/bar[${PYTHON_USEDEP}]"; then |
26 |
einfo "${EPYTHON}: dev-python/bar does not support the impl" |
27 |
return 1 |
28 |
else |
29 |
return 0 |
30 |
fi |
31 |
} |
32 |
|
33 |
Note that the package will need a proper dep as well: |
34 |
|
35 |
DEPEND=" |
36 |
${PYTHON_DEPS} |
37 |
python_targets_python2_7? ( |
38 |
dev-python/foo[python_targets_python2_7] |
39 |
dev-python/bar[python_targets_python2_7] |
40 |
) |
41 |
" |
42 |
|
43 |
Note to self: think how to improve the deps. |
44 |
|
45 |
Please note that the new syntax will be necessary only with more |
46 |
complex cases. Simpler things like package just calling 'pyfoo' script |
47 |
will be handled by simple: |
48 |
|
49 |
DEPEND="dev-python/pyfoo" |
50 |
|
51 |
which will enforce at least one impl for pyfoo, and pyfoo wrapper will |
52 |
handle the rest. |
53 |
|
54 |
-- |
55 |
Best regards, |
56 |
Michał Górny |