On 27/06/12 17:21, Martin Krizek wrote:
Hi, a project I am packaging contains a few python scripts that do not have .py in a name. I gather only files containing .py are bytecompiled during RPM building. And so if there is a file called "script" in the site-packages, it is bytecompiled once the file is used and "scriptc" is created. Then after uninstalling the package, "scriptc" is left on the filesystem. What is the correct/proper way to handle such files? Or even, am I missing something?
Python will only create and use .pyc files for modules that are imported (and thus must be named .py).
Python will never create and never use .pyc (or .pyo) files for "main" programs / scripts.
It is thus absolutely correct and not a problem that your scripts don't have a .pyc.
(It is possible that rpm packaging post processing scripts will create .pyc files for scripts that are named .py. They will be superfluous and it could be considered a minor bug ... but nobody cares. (There used to be created .pyc files for .py files in /usr/bin but that is no longer the case.))
/Mads -- packaging mailing list packaging@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/packaging