From d4a26d93d0939ab246c2fd894c66d4c3a6c0ed9c Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Tue, 5 Sep 2023 00:42:40 -0500 Subject: [PATCH] Remove %py3_build_egg and %py3_install_egg macros. %py3_install_egg is nonfunctional; setuptools removed the easy_install entrypoint years ago. %py3_build_egg is technically functional but has been superseded by newer macros. Calling setup.py directly is deprecated, and building/installing eggs to begin with is deprecated. The macros are not used in any Fedora packages and are broken. It's time to remove them. --- macros.python | 11 ----------- macros.python3 | 11 ----------- python-rpm-macros.spec | 5 ++++- tests/test_evals.py | 2 -- 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/macros.python b/macros.python index 4568614..e058fff 100644 --- a/macros.python +++ b/macros.python @@ -33,11 +33,6 @@ %{__python} %{py_setup} %{?py_setup_args} build --executable="%{__python} %{py_shbang_opts}" %{?*} } -%py_build_egg() %{expand:\\\ - CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ - %{__python} %{py_setup} %{?py_setup_args} bdist_egg %{?*} -} - %py_build_wheel() %{expand:\\\ CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ %{__python} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} @@ -49,12 +44,6 @@ rm -rfv %{buildroot}%{_bindir}/__pycache__ } -%py_install_egg() %{expand:\\\ - mkdir -p %{buildroot}%{python_sitelib} - %{__python} -m easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python_version}.egg %{?*} - rm -rfv %{buildroot}%{_bindir}/__pycache__ -} - %py_install_wheel() %{expand:\\\ %{__python} -m pip install -I dist/%{1} --root %{buildroot} --prefix %{_prefix} --no-deps --no-index --no-warn-script-location rm -rfv %{buildroot}%{_bindir}/__pycache__ diff --git a/macros.python3 b/macros.python3 index 0e4678e..06a7db2 100644 --- a/macros.python3 +++ b/macros.python3 @@ -31,11 +31,6 @@ %{__python3} %{py_setup} %{?py_setup_args} build --executable="%{__python3} %{py3_shbang_opts}" %{?*} } -%py3_build_egg() %{expand:\\\ - CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ - %{__python3} %{py_setup} %{?py_setup_args} bdist_egg %{?*} -} - %py3_build_wheel() %{expand:\\\ CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}"\\\ %{__python3} %{py_setup} %{?py_setup_args} bdist_wheel %{?*} @@ -47,12 +42,6 @@ rm -rfv %{buildroot}%{_bindir}/__pycache__ } -%py3_install_egg() %{expand:\\\ - mkdir -p %{buildroot}%{python3_sitelib} - %{__python3} -m easy_install -m --prefix %{buildroot}%{_prefix} -Z dist/*-py%{python3_version}.egg %{?*} - rm -rfv %{buildroot}%{_bindir}/__pycache__ -} - %py3_install_wheel() %{expand:\\\ %{__python3} -m pip install -I dist/%{1} --root %{buildroot} --prefix %{_prefix} --no-deps --no-index --no-warn-script-location rm -rfv %{buildroot}%{_bindir}/__pycache__ diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 8220091..708cd30 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -53,7 +53,7 @@ elseif posix.stat('macros.python-srpm') then end } Version: %{__default_python3_version} -Release: 3%{?dist} +Release: 4%{?dist} BuildArch: noarch @@ -163,6 +163,9 @@ grep -E '^#[^%%]*%%[^%%]' %{buildroot}%{rpmmacrodir}/macros.* && exit 1 || true %changelog +* Tue Sep 05 2023 Maxwell G - 3.12-4 +- Remove %%py3_build_egg and %%py3_install_egg macros. + * Wed Aug 09 2023 Karolina Surma - 3.11-3 - Declare the license as an SPDX expression diff --git a/tests/test_evals.py b/tests/test_evals.py index 294faaa..2e0e6e1 100644 --- a/tests/test_evals.py +++ b/tests/test_evals.py @@ -707,10 +707,8 @@ unversioned_macros = pytest.mark.parametrize('macro', [ '%python_cache_tag', '%py_shebang_fix', '%py_build', - '%py_build_egg', '%py_build_wheel', '%py_install', - '%py_install_egg', '%py_install_wheel', '%py_check_import', '%py_test_envvars',