From 40bc8f0d8988a6048b7c09370f8d7f68805168b0f6ce5c93adc1d733d4e3e0fe Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Mon, 7 Aug 2023 14:46:36 +0000 Subject: [PATCH] Accepting request 1102688 from home:dirkmueller:Factory - add externally_managed.in to label this build as PEP-668 managed OBS-URL: https://build.opensuse.org/request/show/1102688 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python312?expand=0&rev=18 --- externally_managed.in | 12 ++++++++++++ python312.changes | 5 +++++ python312.spec | 6 ++++++ 3 files changed, 23 insertions(+) create mode 100644 externally_managed.in diff --git a/externally_managed.in b/externally_managed.in new file mode 100644 index 0000000..54606b6 --- /dev/null +++ b/externally_managed.in @@ -0,0 +1,12 @@ +[externally-managed] +Error=To install Python packages system-wide, try + zypper install __PYTHONPREFIX__-xyz, where xyz is the package + you are trying to install. + + If you wish to install a non-rpm packaged Python package, + create a virtual environment using __PYTHON__ -m venv path/to/venv. + Then use path/to/venv/bin/python and path/to/venv/bin/pip. + + If you wish to install a non-rpm packaged Python application, + it may be easiest to use `pipx install xyz`, which will manage a + virtual environment for you. Install pipx via `zypper install __PYTHONPREFIX__-pipx` . diff --git a/python312.changes b/python312.changes index 00be010..a45b3db 100644 --- a/python312.changes +++ b/python312.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Aug 4 06:37:41 UTC 2023 - Dirk Müller + +- add externally_managed.in to label this build as PEP-668 managed + ------------------------------------------------------------------- Thu Aug 3 14:13:30 UTC 2023 - Matej Cepl diff --git a/python312.spec b/python312.spec index b8eb23a..73112c0 100644 --- a/python312.spec +++ b/python312.spec @@ -114,6 +114,7 @@ Source0: https://www.python.org/ftp/python/%{folderversion}/%{tarname}.ta Source1: https://www.python.org/ftp/python/%{folderversion}/%{tarname}.tar.xz.asc Source2: baselibs.conf Source3: README.SUSE +Source4: externally_managed.in Source7: macros.python3 Source8: import_failed.py Source9: import_failed.map @@ -707,6 +708,9 @@ rm %{buildroot}%{_libdir}/libpython3.so rm %{buildroot}%{_libdir}/pkgconfig/{python3,python3-embed}.pc %endif +# PEP-0668 mark this as a distro maintained python +sed -e 's,__PYTHONPREFIX__,%{python_pkg_name},' -e 's,__PYTHON__,python%{python_version},' < %{SOURCE4} > %{buildroot}%{sitedir}/EXTERNALLY-MANAGED + # link shared library instead of static library that tools expect ln -s ../../libpython%{python_abi}.so %{buildroot}%{_libdir}/python%{python_version}/config-%{python_abi}-%{archname}-%{_os}%{?_gnu}%{?armsuffix}/libpython%{python_abi}.so @@ -902,6 +906,8 @@ echo %{sitedir}/_import_failed > %{buildroot}/%{sitedir}/site-packages/zzzz-impo %{_mandir}/man1/python3.1%{?ext_man} %endif %{_mandir}/man1/python%{python_version}.1%{?ext_man} +# PEP-0668 +%{sitedir}/EXTERNALLY-MANAGED # license text, not a doc because the code can use it at run-time %{sitedir}/LICENSE.txt # RPM macros