[packages/python3] mark distro provided python as externally managed

atler atler at pld-linux.org
Tue Dec 23 20:07:19 CET 2025


commit 1c4c7f390e4724f8c1210104baed1181bfbc4fe4
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Dec 23 18:21:01 2025 +0100

    mark distro provided python as externally managed
    
    https://peps.python.org/pep-0668/

 externally-managed | 3 +++
 python3.spec       | 4 ++++
 2 files changed, 7 insertions(+)
---
diff --git a/python3.spec b/python3.spec
index 4af687e..750a672 100644
--- a/python3.spec
+++ b/python3.spec
@@ -56,6 +56,8 @@ Group:		Development/Languages/Python
 Source0:	https://www.python.org/ftp/python/%{version}/Python-%{version}.tar.xz
 # Source0-md5:	41389edaf9c643263cbed9b5ed307df8
 Source1:	pyconfig.h.in
+# https://peps.python.org/pep-0668/
+Source2:	externally-managed
 
 Patch2:		%{name}-multilib.patch
 Patch3:		%{name}-no_cmdline_tests.patch
@@ -653,6 +655,7 @@ install -p Tools/patchcheck/reindent.py $RPM_BUILD_ROOT%{_bindir}/pyreindent%{py
 
 %{__mv} $RPM_BUILD_ROOT%{py_incdir}/pyconfig.h $RPM_BUILD_ROOT%{py_libdir}/config-%{py_platform}/pyconfig.h
 %{__sed} -e's#@PREFIX@#%{_prefix}#g;s#@PY_VER@#%{py_ver}#g;s#@PY_ABI@#%{py_platform}#g' %{SOURCE1} > $RPM_BUILD_ROOT%{py_incdir}/pyconfig.h
+cp -p %{SOURCE2} $RPM_BUILD_ROOT%{py_libdir}/EXTERNALLY-MANAGED
 
 %if %{with default_python}
 # python points to python3 now
@@ -705,6 +708,7 @@ rm -rf $RPM_BUILD_ROOT
 # shared modules required by python library
 %attr(755,root,root) %{py_dyndir}/_struct.cpython-*.so
 
+%{py_libdir}/EXTERNALLY-MANAGED
 # modules required by python library
 %{py_libdir}/__future__.py
 %{py_libdir}/_collections_abc.py
diff --git a/externally-managed b/externally-managed
new file mode 100644
index 0000000..f2ba3ff
--- /dev/null
+++ b/externally-managed
@@ -0,0 +1,3 @@
+[externally-managed]
+Error=To install Python packages system-wide, use poldek -i python3-xyz,
+ where xyz is the package you are trying to install.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3.git/commitdiff/1c4c7f390e4724f8c1210104baed1181bfbc4fe4



More information about the pld-cvs-commit mailing list