cmake for python projects

Wolfgang Rohdewald wolfgang at
Tue Sep 28 22:15:54 BST 2010

On Dienstag 28 September 2010, Rex Dieter wrote:
> +1 here too, no fatal run-time dep checks at build-time.

meanwhile I even wonder if cmake/kde should bytecompile
the .py to .pyc at all. E.g. debian based distros do not do
that anyway, they do that when the package is installed. 
Developers do not need that either. Bytecompiling does not
find missing dependencies either - it happily encodes the
module imports without checking that the modules actually
exist. So there is no reason to do that AFAICS.

This would avoid a couple of potential problems resulting in
recompiling all .py every time the app is started.

if a distro wants to distribute *.pyc (opensuse does), they could
still easily do so after cmake finished. Pseudo code:

interpreter=`find correct interpreter for the target distribution version`
for file in *.py
        using interpreter pythoncompile file

that would work without change for all KDE python projects

so I propose a radical solution for KDE python projects:

no runtime checks at all by cmake, not even warnings, no
bytecompilation but the requirement to define dependencies in
README.packagers and the strong recommendation that the app should 
produce helpful messages when a dependency is not met. One could
argue that the ImportError messages would suffice but the end user
might never see them. Kajongg uses kdialog for those messages.

(kajongg now defines dependencies in kajongg/debian.control but mentions
that in README.packagers)


More information about the kde-core-devel mailing list