From 89c9b407fa0d52bb8d6e54b8031ebdfd3004bd15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 11 Dec 2023 14:16:03 +0100 Subject: [PATCH] Show a better error message when %pyproject_install finds no wheel Fixes: https://bugzilla.redhat.com/2242452 --- macros.pyproject | 4 ++++ pyproject-rpm-macros.spec | 2 ++ 2 files changed, 6 insertions(+) diff --git a/macros.pyproject b/macros.pyproject index f173869..710cb73 100644 --- a/macros.pyproject +++ b/macros.pyproject @@ -65,6 +65,10 @@ echo $(IFS=:; echo "${pyproject_build_lib[*]}") %pyproject_install() %{expand:\\\ specifier=$(ls %{_pyproject_wheeldir}/*.whl | xargs basename --multiple | sed -E 's/([^-]+)-([^-]+)-.+\\\.whl/\\\1==\\\2/') +if [ -z $specifier ]; then + echo 'ERROR: %%%%pyproject_install found no wheel in %%%%{_pyproject_wheeldir} %{_pyproject_wheeldir}' >&2 + exit 1 +fi TMPDIR="%{_pyproject_builddir}" %{__python3} -m pip install --root %{buildroot} --prefix %{_prefix} --no-deps --disable-pip-version-check --progress-bar off --verbose --ignore-installed --no-warn-script-location --no-index --no-cache-dir --find-links %{_pyproject_wheeldir} $specifier if [ -d %{buildroot}%{_bindir} ]; then %py3_shebang_fix %{buildroot}%{_bindir}/* diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index ccbf3de..4f70c85 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -177,6 +177,8 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 - The -L flag explicitly disables this check (which remains the default) - Prevent incorrect usage of %%pyproject_buildrequires -R with -x/-e/-t - Fixes: rhbz#2244282 +- Show a better error message when %%pyproject_install finds no wheel +- Fixes: rhbz#2242452 * Wed Sep 13 2023 Python Maint - 1.10.0-1 - Add %%_pyproject_check_import_allow_no_modules for automated environments