Python3 __pycache__ directory ownership clarification

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Per https://fedoraproject.org/wiki/Packaging:Python#Files_to_include the __pycache__ directory needs shipped in python3-* packages. The default Python template generated by rpmdev-newspec includes %{python3_sitelib}/* which would include __pycache__, no problem. (same applies for python3_sitearch)

However, if the package installs *.py files under %{python3_sitearch} directly (not under a module), the __pycache__ directory ends up being owned by both that package and python3-libs.

e.g. on my current system:
$ rpm -qf /usr/lib/python3.4/site-packages/__pycache__ 
python3-six-1.9.0-1.fc22.noarch
python3-setuptools-17.1.1-3.fc22.noarch
python3-libs-3.4.2-6.fc22.x86_64

Per
https://fedoraproject.org/wiki/Packaging:Guidelines#The_directory_is_also_owned_by_a_package_implementing_required_functionality_of_your_package

Fixing this would involve, taking python3-six for example:
before:
%{python3_sitelib}/*

after:
%{python3_sitelib}/*.*
%{python3_sitelib}/__pycache__/*

Putting this in a template might cause problems though, as if the Python package ships modules, each of the module would have to be listed separately.

Should we err on the side of simplicity (and end up with potentially multiple owners of site{lib,arch}/__pycache__ ? I am reviewing two packages where this takes place:

python-line_profiler
https://bugzilla.redhat.com/show_bug.cgi?id=1241919

python-scandir
https://bugzilla.redhat.com/show_bug.cgi?id=1245845

Thanks,

-- 
Michel Alexandre Salim
--
packaging mailing list
packaging@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/packaging

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Forum]     [KDE Users]

  Powered by Linux