[packages/rpm-pld-macros] 2.0.55; enable all python optimization files
arekm
arekm at pld-linux.org
Fri Mar 20 20:44:13 CET 2026
commit b200ac4356f069e11c1f906d9d3f30dbc8b99f9f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Fri Mar 20 20:44:00 2026 +0100
2.0.55; enable all python optimization files
macros.python | 8 +++++++-
rpm-pld-macros.spec | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/rpm-pld-macros.spec b/rpm-pld-macros.spec
index 0f3c595..3675fb9 100644
--- a/rpm-pld-macros.spec
+++ b/rpm-pld-macros.spec
@@ -1,4 +1,4 @@
-%define rpm_macros_rev 2.054
+%define rpm_macros_rev 2.055
%define find_lang_rev 1.42
# split into individual X_prov_ver if there is a reason to desync
%define prov_ver 4.15
diff --git a/macros.python b/macros.python
index 8537d5f..8bdb00d 100644
--- a/macros.python
+++ b/macros.python
@@ -139,9 +139,15 @@
# "shrink" filter to keep this macro without newlines,
# so it could be used as make arguments
+# Note: unlike setup.py's --optimize=N which always generates level 0 bytecode
+# plus the requested level, python3 -m installer --compile-bytecode=N generates
+# ONLY the specified level(s). We need 0 (used by default python3 invocation),
+# 1 (used by python3 -O) and 2 (used by python3 -OO). Without level 0, Python
+# has to recompile from .py source on every import since it won't use .opt-N.pyc
+# files for non-optimized runs.
%py3_install_pyproject_opts() %{shrink: \
--prefix=%{_prefix} \
- --compile-bytecode=2 \
+ --compile-bytecode=0 --compile-bytecode=1 --compile-bytecode=2 \
}
%py3_install_pyproject { \
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rpm-pld-macros.git/commitdiff/b200ac4356f069e11c1f906d9d3f30dbc8b99f9f
More information about the pld-cvs-commit
mailing list