openSUSE / python-rpm-macros

Multi-Python, Single-Spec macros generator
Other
22 stars 20 forks source link

%pyproject_install macro should include --no-compile. #37

Closed mcepl closed 5 years ago

mcepl commented 5 years ago

Fixes bsc#1094323

CC: @bmwiedemann

bmwiedemann commented 5 years ago

Yes, this should fix the problem of unreproducible .pyc files. However, it also left the package I tested without .pyc files, which could give some percent penalty in startup time.

bnavigator commented 4 years ago

Maybe add something like the following to the %pyproject_install macro instead?

for d in %{buildroot}%{$python_sitelib} %{buildroot}%{$python_sitearch}; do
  if [ -d $d ]; then
    $python -m compileall $d
    $python -O -m compileall $d
  fi
done