python3.2+ compiled files

Artur Wroblewski wrobell at pld-linux.org
Sun May 22 04:21:27 CEST 2011


On Sat, May 21, 2011 at 1:12 PM, Jacek Konieczny <jajcus at jajcus.net> wrote:
> On Sat, May 21, 2011 at 12:22:04PM +0100, Artur Wroblewski wrote:
>> On Fri, May 20, 2011 at 11:34 AM, Jacek Konieczny <jajcus at jajcus.net> wrote:
>> > Maybe we should have some automation for packaging (or not
>> > packaging) __pycache__ and its contents? So it doesn't have to be listed
>> > explicitly for every python package. I am thinking about something like
>> > %find_lang – e.g. %find_pybytcode, or '%py_listmodules modul1e module2'
>>
>> %find_pymod mod1 mod2... ?
>>
>> it has to find egg files (on the same level as mod1 and mod2 exist), *.py,
>> *.so and directories (it will get __pycache__ then too).
>>
>> Do I miss anything?
>
> I don't think we want any directory found packaged. All python
> modules/packages should be explicitely listed and only files
> belonging to them for sure should be included. Only this way we can
> notice things that should not go to %py_sitedir or new modules/packages
> that we may want to package separately.

IMO

    %find_pymod mod1 mod2

should include (by listing each file, wildcards below
just for my convenience)

%dir %{py_sitedir}/mod1
%dir %{py_sitedir}/mod1/submod1
%{py_sitedir}/mod1/*.py
%{py_sitedir}/mod1/__pycache__
%attr(...) %{py_sitedir}/mod1/*.so

%{py_sitedir}/mod1/submod1/*.py
%{py_sitedir}/mod1/submod1/__pycache__
%attr(...) %{py_sitedir}/mod1/submod1/*.so

but would skip

%{py_sitedir}/mod1/submod1/*.txt
%{py_sitedir}/mod1/submod1/test{,s}
%{py_sitedir}/mod1/adir   # this directory contains no __init__.py
%{py_sitedir}/mod1/adir/somedata.file.txt

> There is a problem with egg-info files then - they may not match exactly
> the python module/package name.

If I reckon well, we never skipped any egg files.

Regards,

w


More information about the pld-devel-en mailing list