Use %py3_test_envvars in %tox when available
The new %py3_test_envvars macro was added to remove duplication of environment variables used in %check. We reuse it in %tox to gain support e.g. for PYTEST_XDIST_AUTO_NUM_WORKERS. However, we keep support for platforms where the macro is not yet available, not to be forced to backport %py3_test_envvars everywhere right away. Technically, this should change little, but it sets CFLAGS and LDFLAGS now, hence a new Y version.
This commit is contained in:
parent
cb40ce3612
commit
f21e684a67
@ -175,8 +175,9 @@ Then, use the `%tox` macro in `%check`:
|
|||||||
|
|
||||||
The macro:
|
The macro:
|
||||||
|
|
||||||
- Always prepends `$PATH` with `%{buildroot}%{_bindir}`
|
- Sets environment variables via `%{py3_test_envvars}`, namely:
|
||||||
- If not defined, sets `$PYTHONPATH` to `%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}`
|
- 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 `*`
|
- If not defined, sets `$TOX_TESTENV_PASSENV` to `*`
|
||||||
- Runs `tox` with `-q` (quiet), `--recreate` and `--current-env` (from [tox-current-env]) flags
|
- 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`
|
- Implicitly uses the tox environment name stored in `%{toxenv}` - as overridden by `%pyproject_buildrequires -e`
|
||||||
|
@ -176,10 +176,10 @@ fi
|
|||||||
|
|
||||||
%tox(e:) %{expand:\\\
|
%tox(e:) %{expand:\\\
|
||||||
TOX_TESTENV_PASSENV="${TOX_TESTENV_PASSENV:-*}" \\
|
TOX_TESTENV_PASSENV="${TOX_TESTENV_PASSENV:-*}" \\
|
||||||
PYTHONDONTWRITEBYTECODE=1 \\
|
%{?py3_test_envvars}%{?!py3_test_envvars:PYTHONDONTWRITEBYTECODE=1 \\
|
||||||
PATH="%{buildroot}%{_bindir}:$PATH" \\
|
PATH="%{buildroot}%{_bindir}:$PATH" \\
|
||||||
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \\
|
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" \\
|
HOSTNAME="rpmbuild" \\
|
||||||
%{__python3} -m tox --current-env -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*}
|
%{__python3} -m tox --current-env -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ License: MIT
|
|||||||
# Increment Y and reset Z when new macros or features are added
|
# Increment Y and reset Z when new macros or features are added
|
||||||
# Increment Z when this is a bugfix or a cosmetic change
|
# Increment Z when this is a bugfix or a cosmetic change
|
||||||
# Dropping support for EOL Fedoras is *not* considered a breaking change
|
# Dropping support for EOL Fedoras is *not* considered a breaking change
|
||||||
Version: 1.4.0
|
Version: 1.5.0
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
|
|
||||||
# Macro files
|
# Macro files
|
||||||
@ -127,6 +127,9 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Mon Nov 28 2022 Miro Hrončok <mhroncok@redhat.com> - 1.5.0-1
|
||||||
|
- Use %%py3_test_envvars in %%tox when available
|
||||||
|
|
||||||
* Mon Sep 19 2022 Python Maint <python-maint@redhat.com> - 1.4.0-1
|
* Mon Sep 19 2022 Python Maint <python-maint@redhat.com> - 1.4.0-1
|
||||||
- %%pyproject_save_files: Support License-Files installed into the *Root License Directory* from PEP 369
|
- %%pyproject_save_files: Support License-Files installed into the *Root License Directory* from PEP 369
|
||||||
- Fixes: rhbz#2127946
|
- Fixes: rhbz#2127946
|
||||||
|
Loading…
Reference in New Issue
Block a user