From 363efedd1fe3cf0eab5fc9b421b2c1c793a71e50 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 16 2023 06:07:14 +0000 Subject: import python-rpm-macros-3-45.el8 --- diff --git a/SOURCES/macros.python-srpm b/SOURCES/macros.python-srpm index bdd13cb..f727c80 100644 --- a/SOURCES/macros.python-srpm +++ b/SOURCES/macros.python-srpm @@ -7,6 +7,19 @@ %py3_other_build /bin/true %py3_other_install /bin/true +# Define where Python wheels will be stored and the prefix of -wheel packages +# - In Fedora we want wheel subpackages named e.g. `python-pip-wheel` that +# install packages into `/usr/share/python-wheels`. Both names are not +# versioned, because they're used by all Python 3 stacks. +# - In RHEL we want wheel packages named e.g. `python3-pip-wheel` and +# `python3.11-pip-wheel` that install packages into similarly versioned +# locations. We want each Python stack in RHEL to have their own wheels, +# because the main python3 wheels (which we can't upgrade) will likely be +# quite old by the time we're adding new alternate Python stacks. +# - In ELN we want to follow Fedora, because builds for ELN and Fedora rawhide +# need to be interoperable. +%python_wheel_pkg_prefix python%{?rhel:%{!?eln:%{python3_pkgversion}}} +%python_wheel_dir %{_datadir}/%{python_wheel_pkg_prefix}-wheels # === Macros for Build/Requires tags using Python dist tags === diff --git a/SOURCES/macros.python3 b/SOURCES/macros.python3 index c8d2d9e..584f9a8 100644 --- a/SOURCES/macros.python3 +++ b/SOURCES/macros.python3 @@ -2,8 +2,8 @@ %python3 %__python3 %python3_sitelib %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python3_sitearch %(%{__python3} -Ic "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") -%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3])") -%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write(sys.version[:3].replace('.',''))") +%python3_version %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") +%python3_version_nodots %(%{__python3} -Ic "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info).replace('.',''))") %python3_platform %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_platform())") %python3_platform_triplet %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_config_var('MULTIARCH'))") %python3_ext_suffix %(%{__python3} -Ic "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))") diff --git a/SPECS/python-rpm-macros.spec b/SPECS/python-rpm-macros.spec index f36d9b2..7b93243 100644 --- a/SPECS/python-rpm-macros.spec +++ b/SPECS/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 43%{?dist} +Release: 45%{?dist} Summary: The unversioned Python RPM macros License: MIT @@ -75,6 +75,14 @@ install -m 644 %{SOURCE0} %{SOURCE1} %{SOURCE2} %{SOURCE3} %{SOURCE4} \ %changelog +* Wed Feb 22 2023 Miro HronĨok - 3-45 +- Fix %%python3_version macros for Python 3.10+ +Resolves: rhbz#2169780 + +* Fri Oct 14 2022 Charalampos Stratakis - 3-44 +- Backport the %%python_wheel_pkg_prefix and the %%python_wheel_dir macros from Fedora +Resolves: rhbz#2143991 + * Tue Jul 26 2022 Tomas Orsava - 3-43 - Make %%pytest macro respect %%python3_pkgversion Resolves: rhbz#2091462