buildroot/package/python
Yegor Yefremov 549bbba67f python/python3: globalize *.pyc files compilation
Currently, each python package (be it the python interpreter package
itself or external python modules) is responsible for compiling its
.py into .pyc files. Unfortunately, this is not ideal as some packages
only install .py files without compiling them into .pyc files. In this
case, if the Buildroot configuration specifies to keep only the .pyc
files, the .py files are removed and lost.

To address this, this commit changes the logic by making the
compilation of .pyc files a global operation: the python interpreter
packages register a target finalize hook that is in charge of
compiling all installed .py files.

The *.pyc generation on a per package basis is disabled in the
python-package infrastructure by passing the "--no-compile" option to
setup.py.

The *.pyc generation for the Python interpreter internal modules is
disabled through --disable-pyc-build configure option.

A small helper script is used to perform the compilation, the purpose
of this script is to abort the compilation process if one of the .py
file cannot be compiled. It has been provided by Samuel Martin and
integrated into this commit.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Cc: Samuel Martin <s.martin49@gmail.com>
[Thomas:
 - rework for python 3.5
 - integrate Samuel proposal that allows to detect compilation
   failures.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: Samuel Martin <s.martin49@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-05-26 22:07:35 +02:00
..
001-remove-host-header-path.patch
002-fix-get-python-inc.patch
004-sysconfigdata-install-location.patch
005-pyc-pyo-conditional.patch
006-cross-compile-getaddrinfo.patch
007-disable-extensions.patch
008-distutils-use-python-sysroot.patch
009-no-termcap-host-path.patch
010-fix-python-config.patch
011-remove-python-symlink.patch
013-dont-add-multiarch-path.patch
014-abort-on-failed-modules.patch
015-fix-sqlite-without-threads.patch
016-serial-ioctl-workaround.patch
017-distutils-scripts-dont-adjust-shebang.patch
018-fix-add-gcc-paths-logic.patch
100-optional-test-modules.patch
101-optional-pydoc.patch
102-optional-2to3.patch
103-optional-sqlite.patch
104-optional-tk.patch
105-optional-curses.patch
106-optional-expat.patch
107-optional-codecs-cjk.patch
108-optional-nis.patch
109-optional-unicodedata.patch
110-optional-db.patch
111-optional-ssl.patch
112-optional-bzip2.patch
113-optional-zlib.patch
114-remove-idle-editor.patch
115-optional-ossaudiodev.patch
Config.in
python.hash
python.mk python/python3: globalize *.pyc files compilation 2016-05-26 22:07:35 +02:00