From f8479daf3bea30ff2761c73a176c48b07307e1ae Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Tue, 29 Aug 2023 23:30:18 +0200 Subject: [PATCH] Convert the SPEC to pyproject macros --- python-argcomplete.spec | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/python-argcomplete.spec b/python-argcomplete.spec index fd08d2c..227a07f 100644 --- a/python-argcomplete.spec +++ b/python-argcomplete.spec @@ -28,7 +28,6 @@ Patch: Ensure-Python-3.7-compatibility-in-check_console_script.patch Patch: Ensure-Python-3.12-compatibility-in-check_console_script.patch BuildRequires: python3-devel -BuildRequires: python3-setuptools %if %{with check} BuildRequires: tcsh @@ -70,11 +69,16 @@ sed -i -r -e '/tests_require = /s/"(coverage|flake8|wheel)"[, ]*//g' setup.py sed -i -e "1s|#!.*python.*|#!%{__python3}|" test/prog scripts/* sed -i -e "s|python |python3 |" test/test.py +%generate_buildrequires +%pyproject_buildrequires %{?with_check:-x test} + %build -%py3_build +%pyproject_wheel %install -%py3_install +%pyproject_install +%pyproject_save_files argcomplete + # do not attempt to install to %%bash_completions_dir, see https://bugzilla.redhat.com/2211862 install -Dp -m0644 argcomplete/bash_completion.d/%{name} %{buildroot}%{_sysconfdir}/bash_completion.d/%{name} @@ -89,11 +93,9 @@ export INPUTRC=$PWD/.inputrc %{python3} setup.py test %endif -%files -n python3-argcomplete +%files -n python3-argcomplete -f %{pyproject_files} %license LICENSE.rst %doc README.rst -%{python3_sitelib}/argcomplete-*.egg-info/ -%{python3_sitelib}/argcomplete/ %{_bindir}/activate-global-python-argcomplete %{_bindir}/python-argcomplete-check-easy-install-script %{_bindir}/python-argcomplete-tcsh