On Fri, Apr 20, 2012 at 5:47 PM, Jacek Konieczny <jaj...@jajcus.net> wrote: > On Fri, Apr 20, 2012 at 06:40:53PM +0300, Elan Ruusamäe wrote: >> it doesn't behave here so: >> >> here it creates .pyc only for imported modules, if invoked via >> #!/shebang, no .pyc is created for the script itself: > [...] >> > In case if %{_bindir} or %{_sbindir} - no script should be named *.py >> > there (actually there are some, but they should be fixed). >> > >> any explanation why (not that i have against) > > The problem is, that if script name is "something.py", then > if any other python script in the same directory does > 'import something' (on purpose or because of a name collision) the > script will be compiled to pyc. > > There should be no *.py files in %{_bindir}. If a script is supposed to > be importable, then it should be stored in %{py_sitescriptdir}, and only > a wrapper script should be kept in %{_bindir}. > > The wrapper can be something like that: > > #!/usr/bin/python > import something > somethig.run() > > or > > #!/bin/sh > exec /usr/bin/python -m something "$@" > > Whatever the module expects.
python3.spec simply creates aliases in /etc/shrc.d. regards, w _______________________________________________ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en