FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Packaging

 
 
LinkBack Thread Tools
 
Old 06-27-2012, 03:21 PM
Martin Krizek
 
Default Python compiled files without .py in a name

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?

Thanks,
Martin
--
packaging mailing list
packaging@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 
Old 06-27-2012, 03:43 PM
Mads Kiilerich
 
Default Python compiled files without .py in a name

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@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/packaging
 

Thread Tools




All times are GMT. The time now is 07:22 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org