diff --git a/README.md b/README.md index 92a7e65..970580b 100644 --- a/README.md +++ b/README.md @@ -175,8 +175,9 @@ Then, use the `%tox` macro in `%check`: The macro: - - Always prepends `$PATH` with `%{buildroot}%{_bindir}` - - If not defined, sets `$PYTHONPATH` to `%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}` + - Sets environment variables via `%{py3_test_envvars}`, namely: + - Always prepends `$PATH` with `%{buildroot}%{_bindir}` + - If not defined, sets `$PYTHONPATH` to `%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}` - If not defined, sets `$TOX_TESTENV_PASSENV` to `*` - Runs `tox` with `-q` (quiet), `--recreate` and `--current-env` (from [tox-current-env]) flags - Implicitly uses the tox environment name stored in `%{toxenv}` - as overridden by `%pyproject_buildrequires -e` diff --git a/macros.pyproject b/macros.pyproject index ca1ca68..a0cdb72 100644 --- a/macros.pyproject +++ b/macros.pyproject @@ -176,10 +176,10 @@ fi %tox(e:) %{expand:\\\ TOX_TESTENV_PASSENV="${TOX_TESTENV_PASSENV:-*}" \\ -PYTHONDONTWRITEBYTECODE=1 \\ +%{?py3_test_envvars}%{?!py3_test_envvars:PYTHONDONTWRITEBYTECODE=1 \\ PATH="%{buildroot}%{_bindir}:$PATH" \\ PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \\ -%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"} \\ +%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"}} \\ HOSTNAME="rpmbuild" \\ %{__python3} -m tox --current-env -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*} } diff --git a/pyproject-rpm-macros.spec b/pyproject-rpm-macros.spec index ab1d985..8f93bdc 100644 --- a/pyproject-rpm-macros.spec +++ b/pyproject-rpm-macros.spec @@ -10,7 +10,7 @@ License: MIT # Increment Y and reset Z when new macros or features are added # Increment Z when this is a bugfix or a cosmetic change # Dropping support for EOL Fedoras is *not* considered a breaking change -Version: 1.4.0 +Version: 1.5.0 Release: 1%{?dist} # Macro files @@ -127,6 +127,9 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856 %license LICENSE %changelog +* Mon Nov 28 2022 Miro HronĨok - 1.5.0-1 +- Use %%py3_test_envvars in %%tox when available + * Mon Sep 19 2022 Python Maint - 1.4.0-1 - %%pyproject_save_files: Support License-Files installed into the *Root License Directory* from PEP 369 - Fixes: rhbz#2127946