From 1e199ca6f4a048805c0d0262156c9992521b69ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 4 Sep 2020 00:16:27 +0200 Subject: [PATCH] Make code in $PWD importable from %pyproject_buildrequires In %pyproject_buildrequires, don't run python with -I but -s. This allows projects used by the script itself, such as packaging or toml, to be packaged using the macros, using "self" -- i.e. the code from $PWD. --- macros.pyproject | 2 +- pyproject-rpm-macros.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/macros.pyproject b/macros.pyproject index 51cc8dd..51326ab 100644 --- a/macros.pyproject +++ b/macros.pyproject @@ -88,7 +88,7 @@ fi # setuptools assumes no pre-existing dist-info rm -rfv *.dist-info/ >&2 if [ -f %{__python3} ]; then - RPM_TOXENV="%{toxenv}" HOSTNAME="rpmbuild" %{__python3} -I %{_rpmconfigdir}/redhat/pyproject_buildrequires.py $extras_flag --python3_pkgversion %{python3_pkgversion} %{?**} + RPM_TOXENV="%{toxenv}" HOSTNAME="rpmbuild" %{__python3} -s %{_rpmconfigdir}/redhat/pyproject_buildrequires.py $extras_flag --python3_pkgversion %{python3_pkgversion} %{?**} fi } diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index 6cdac93..9c7c8d7 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -6,7 +6,7 @@ License: MIT # Keep the version at zero and increment only release Version: 0 -Release: 26%{?dist} +Release: 27%{?dist} # Macro files Source001: macros.pyproject @@ -88,6 +88,9 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 %license LICENSE %changelog +* Fri Sep 4 2020 Miro HronĨok - 0-27 +- Make code in $PWD importable from %%pyproject_buildrequires + * Mon Aug 24 2020 Tomas Hrnciar - 0-26 - Implement automatic detection of %%lang files in %%pyproject_save_files and mark them with %%lang in filelist