Gentoo Archives: gentoo-dev

From: Ali Polatel <hawking@g.o>
To: gentoo-dev-announce@l.g.o
Cc: gentoo-dev@l.g.o
Subject: [gentoo-dev] Recent changes wrt python.eclass
Date: Thu, 29 May 2008 18:57:03
Message-Id: 20080529185644.GB4994@trippin
1 Hi people,
3 All python_mod_* functions are now ROOT aware. I've also modified them
4 to die if they aren't run in expected phases. Also I plan to make byte
5 compiling functions print a warning when *.py{c,o} are installed under
6 /usr/share which is a FHS violation.
8 The tree and python developer's guide are updated to reflect the
9 changes.
11 As a last thing, I want to give some usage notes here so it's
12 clear for everyone.
14 * If your package uses distutils.eclass, generally you have nothing to
15 worry about. By default it'll byte compile python modules under
16 /usr/$(get_libdir)/python${PYVER}/site-packages/${PN}. If your package
17 installs a directory with a name other than ${PN} set PYTHON_MODNAME
18 to the name of directory.
20 * python_version should only be called if you need any of PYVER*
21 variables. If your package only uses python.eclass - and not
22 distutils.eclass, you need to call it when you want to use $python
23 too. ( Note: Right now python_version is buggy wrt ROOT. This is the
24 next thing I'm going to fix.)
26 * Don't call python_mod_cleanup with PYVER like:
27 Wrong:
28 python_mod_cleanup \
29 /usr/$(get_libdir)/python${PYVER}/site-packages/$PN
31 This is wrong because the python version may change in the meantime.
32 Instead use:
33 python_mod_cleanup \
34 /usr/$(get_libdir)/python*/site-packages/$PN
36 python_mod_cleanup has a safe default so you can usually avoid passing
37 any arguments.
39 These are important stuff I can remember by the time I'm writing this
40 mail. Python devguide will be updated with these useful information
41 soon.
43 So if anything is not clear and/or you have any questions feel free to
44 bug/poke/stab me :-)
46 --
47 Regards,
48 Ali Polatel