[opensuse-factory] Re: [opensuse-packaging] Strange issue in python package: CUPS-Cloud-Print
Le 10/10/2014 09:34, Johannes Meixner a écrit :
Hello,
On Oct 9 11:17 Greg Freemyer wrote (excerpt):
On October 9, 2014 6:09:39 AM EDT, Todd Rme
wrote: On Thu, Oct 9, 2014 at 12:05 AM, Greg Freemyer
wrote: All,
I'm trying to package the Google Cups Cloud Proxy Printer
https://build.opensuse.org/package/show/home:gregfreemyer:branches:home:sbra...
...
The failed builds report:
[ 147s] error: Installed (but unpackaged) file(s) found: [ 147s] /usr/share/cloudprint-cups/auth.pyc [ 147s] /usr/share/cloudprint-cups/ccputils.pyc ... You could try manually creating the .pyc files in the %install section so they will always be there. You should be able to use "python -m compileall %{buildroot}%{_datadir}/cloudprint-cups/" to generate the .pyc files.
Thank you, that seems to have fixed it.
I assume .pyc files are not architecture independent so that a package that contains .pyc files cannot be "noarch".
When I am right, "BuildArch: noarch" must be removed from OBS home:gregfreemyer:branches:home:sbrabec/CUPS-Cloud-Print/CUPS-Cloud-Print.spec
I am not at all a Python expert. Nevertheless I think it is not the right solution to compile Python files during build time in the build system environment. I think Python is meant to be compiled as needed on each end-user's system in his particular environment. Therefore I think RPMs with Python software should not contain compiled Python stuff but only the sources.
FYI: In general regarding .pyc (and perhaps .pyo) files: I have a RPM package (hplip) that contains many .py files. When python created the .pyc files those files do not belong to the RPM which means plain removing the RPM would leave its .pyc files on the system. Therefore I have a RPM preun script that removes the .pyc files. I need a simple generic method because I do not have the time to maintain a long list of individual files via RPM ghost, see Printing/hplip/hplip.spec If this is not the right way how to make a RPM with Python software, I appreciate a submitrequest from a Python expert that actually does it in the right way. Note that it must also "just work" for SLE11, see "osc results Printing hplip".
Kind Regards Johannes Meixner
You're wrong. A large part of python packages provided in openSUSE are byte-compiled during build time. Regards. Benjamin -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Hello, On Oct 10 10:38 denisart benjamin2 wrote (fullquote):
You're wrong. A large part of python packages provided in openSUSE are byte-compiled during build time.
Please be more clear what you mean. I assume that another large part of Python software is not provided in byte-compiled form. What should I conclude from it? I wrote also about "noarch". Do you also say that byte-compiled Python files are still architecture independent? I am not at all a Python expert. I would prefer comprehensible information. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Le 10/10/2014 11:07, Johannes Meixner a écrit :
Hello,
On Oct 10 10:38 denisart benjamin2 wrote (fullquote):
You're wrong. A large part of python packages provided in openSUSE are byte-compiled during build time.
Please be more clear what you mean.
I assume that another large part of Python software is not provided in byte-compiled form. What should I conclude from it?
I wrote also about "noarch". Do you also say that byte-compiled Python files are still architecture independent?
I am not at all a Python expert. I would prefer comprehensible information.
Kind Regards Johannes Meixner
Oh yeap sorry. When you launch a setup.py script, the python libraries are byte-compiled. But notice that noarch packages are still arch inderpendent. The byte-compiling process allow libraries to get launched faster by the python machine interpreter. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Friday, October 10, 2014 10:38:40 denisart benjamin2 wrote:
Le 10/10/2014 09:34, Johannes Meixner a écrit :
I assume .pyc files are not architecture independent so that a package that contains .pyc files cannot be "noarch".
.pyo/.pyc is arch independent bytecode. Bytecode is only created for imported modules, not the script itself. In case of hplip, this is all the stuff in the /usr/share/hplip/* subdirectories, e.g. /usr/share/hplip/base/*py Bytecompiling does only influence startup time, not execution speed. Bytecode generation can be controlled: https://docs.python.org/2/library/sys.html#sys.dont_write_bytecode Currently, hplip is about 10MB, shipping the bytecode would add about 1MB. Kind regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019 work: +49 2405 49936-424-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (3)
-
Brüns, Stefan
-
denisart benjamin2
-
Johannes Meixner