From 0086612c9853bd60ae73d9f6a89a9f2b0eb6fd31 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Jul 20 2020 16:13:44 +0000 Subject: Define %python_platform (as a Python version agnostic option to %python3_platform) %python2_platform is also defined, for consistency. --- diff --git a/macros.python b/macros.python index 2ecb49d..85c1896 100644 --- a/macros.python +++ b/macros.python @@ -4,6 +4,7 @@ %python_sitearch %(%{__python} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %python_version %(%{__python} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") %python_version_nodots %(%{__python} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") +%python_platform %(%{__python} -Esc "import sysconfig; print(sysconfig.get_platform())") %py_setup setup.py %py_shbang_opts -s diff --git a/macros.python2 b/macros.python2 index df8e804..201f2bd 100644 --- a/macros.python2 +++ b/macros.python2 @@ -2,6 +2,7 @@ %python2_sitearch %(%{__python2} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %python2_version %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") %python2_version_nodots %(%{__python2} -Esc "import sys; sys.stdout.write('{0.major}{0.minor}'.format(sys.version_info))") +%python2_platform %(%{__python2} -Esc "import sysconfig; print(sysconfig.get_platform())") %py2_shbang_opts -s %py2_shbang_opts_nodash %(opts=%{py2_shbang_opts}; echo ${opts#-}) diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 5e5dac3..e476166 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -111,6 +111,7 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/ - Make the unversioned %%__python macro error - https://fedoraproject.org/wiki/Changes/PythonMacroError - Make %%python macros more consistent with %%python3 macros +- Define %%python_platform (as a Python version agnostic option to %%python3_platform) * Wed Jul 08 2020 Miro Hrončok - 3.9-5 - Introduce %%python_extras_subpkg diff --git a/tests/test_evals.py b/tests/test_evals.py index 917b355..a46c6ad 100644 --- a/tests/test_evals.py +++ b/tests/test_evals.py @@ -371,6 +371,7 @@ unversioned_macros = pytest.mark.parametrize('macro', [ '%python_version_nodots', '%python_sitelib', '%python_sitearch', + '%python_platform', '%py_shebang_fix', '%py_build', '%py_build_egg',