|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
# This is a directory where wheels are stored and installed from, relative to PWD
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
29157c1 |
%_pyproject_wheeldir %{_builddir}%{?buildsubdir:/%{buildsubdir}}/pyproject-wheeldir
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
# This is a directory used as TMPDIR, where pip copies sources to and builds from, relative to PWD
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
# For proper debugsource packages, we create TMPDIR within PWD
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
# See https://github.com/pypa/pip/issues/7555#issuecomment-595180864
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
#
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
# This will be used in debugsource package paths (applies to extension modules only)
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
# NB: pytest collects tests from here if not hidden
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
# https://docs.pytest.org/en/latest/reference.html#confval-norecursedirs
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
29157c1 |
%_pyproject_builddir %{_builddir}%{?buildsubdir:/%{buildsubdir}}/.pyproject-builddir
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
49a323e |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
%pyproject_files %{_builddir}/pyproject-files
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
%pyproject_ghost_distinfo %{_builddir}/pyproject-ghost-distinfo
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
894e212 |
%pyproject_record %{_builddir}/pyproject-record
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
5470f56 |
# Avoid leaking %%{_pyproject_builddir} to pytest collection
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
5470f56 |
# https://bugzilla.redhat.com/show_bug.cgi?id=1935212
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
5470f56 |
# The value is read and used by the %%pytest and %%tox macros:
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
5470f56 |
%_set_pytest_addopts %global __pytest_addopts --ignore=%{_pyproject_builddir}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
5470f56 |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
162b0ca |
%pyproject_wheel() %{expand:\\\
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
5470f56 |
%_set_pytest_addopts
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
29157c1 |
mkdir -p "%{_pyproject_builddir}"
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
29157c1 |
CFLAGS="${CFLAGS:-${RPM_OPT_FLAGS}}" LDFLAGS="${LDFLAGS:-${RPM_LD_FLAGS}}" TMPDIR="%{_pyproject_builddir}" \\\
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
95ba837 |
%{__python3} -m pip wheel --wheel-dir %{_pyproject_wheeldir} --no-deps --use-pep517 --no-build-isolation --disable-pip-version-check --no-clean --progress-bar off --verbose .
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
162b0ca |
}
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
162b0ca |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
162b0ca |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
162b0ca |
%pyproject_install() %{expand:\\\
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
19f84b1 |
specifier=$(ls %{_pyproject_wheeldir}/*.whl | xargs basename --multiple | sed -E 's/([^-]+)-([^-]+)-.+\\\.whl/\\\1==\\\2/')
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
29157c1 |
TMPDIR="%{_pyproject_builddir}" %{__python3} -m pip install --root %{buildroot} --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
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
fdf5116 |
if [ -d %{buildroot}%{_bindir} ]; then
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
a506123 |
%py3_shebang_fix %{buildroot}%{_bindir}/*
|
|
![](https://seccdn.libravatar.org/avatar/6750fa49d765353ea0a91857a0157c1d76531f88d578a26f57978bd76d16c01c?s=16&d=retro) |
8cce1fa |
rm -rfv %{buildroot}%{_bindir}/__pycache__
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
162b0ca |
fi
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
rm -f %{pyproject_ghost_distinfo}
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
site_dirs=()
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
# Process %%{python3_sitelib} if exists
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
fdf5116 |
if [ -d %{buildroot}%{python3_sitelib} ]; then
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
site_dirs+=( "%{python3_sitelib}" )
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
253976c |
fi
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
# Process %%{python3_sitearch} if exists and does not equal to %%{python3_sitelib}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
if [ %{buildroot}%{python3_sitearch} != %{buildroot}%{python3_sitelib} ] && [ -d %{buildroot}%{python3_sitearch} ]; then
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
site_dirs+=( "%{python3_sitearch}" )
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
fi
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
# Process all *.dist-info dirs in sitelib/sitearch
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
for site_dir in ${site_dirs[@]}; do
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
for distinfo in %{buildroot}$site_dir/*.dist-info; do
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
echo "%ghost ${distinfo#%{buildroot}}" >> %{pyproject_ghost_distinfo}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
sed -i 's/pip/rpm/' ${distinfo}/INSTALLER
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
PYTHONPATH=%{_rpmconfigdir}/redhat \\
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
%{__python3} -B %{_rpmconfigdir}/redhat/pyproject_preprocess_record.py \\
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
--buildroot %{buildroot} --record ${distinfo}/RECORD --output %{pyproject_record}
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
c5d2f62 |
rm -fv ${distinfo}/RECORD
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
c5d2f62 |
rm -fv ${distinfo}/REQUESTED
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
done
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
8d5b3ac |
done
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
lines=$(wc -l %{pyproject_ghost_distinfo} | cut -f1 -d" ")
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
if [ $lines -ne 1 ]; then
|
|
![](https://seccdn.libravatar.org/avatar/8671797db956da8fb5b6a76ebdb0def8ddf5dbe18c8a154c0589f8f55f9e3f3e?s=16&d=retro) |
3309d2d |
echo -e "\\n\\nWARNING: %%%%pyproject_extras_subpkg won't work without explicit -i or -F, found $lines dist-info directories.\\n\\n" >&2
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
rm %{pyproject_ghost_distinfo} # any attempt to use this will fail
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
fdf5116 |
fi
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
fdf5116 |
}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
fdf5116 |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
7e5adc9 |
# Note: the three times nested questionmarked -i -f -F pattern means: If none of those options was used -- in that case, we inject our own -f
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
7e5adc9 |
%pyproject_extras_subpkg(n:i:f:F) %{expand:%{?python_extras_subpkg:%{python_extras_subpkg%{?!-i:%{?!-f:%{?!-F: -f %{pyproject_ghost_distinfo}}}} %**}}}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
cb4e43c |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
%pyproject_save_files() %{expand:\\\
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
%{__python3} %{_rpmconfigdir}/redhat/pyproject_save_files.py \\
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
--output "%{pyproject_files}" \\
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
--buildroot "%{buildroot}" \\
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
--sitelib "%{python3_sitelib}" \\
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
--sitearch "%{python3_sitearch}" \\
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
--python-version "%{python3_version}" \\
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
894e212 |
--pyproject-record "%{pyproject_record}" \\
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
%{*}
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
}
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ec07317 |
%default_toxenv py%{python3_version_nodots}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ec07317 |
%toxenv %{default_toxenv}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
0124d2a |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
%pyproject_buildrequires(rxtNe:) %{expand:\\\
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
%{-N:
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
%{-r:%{error:The -N and -r options are mutually exclusive}}
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
%{-x:%{error:The -N and -x options are mutually exclusive}}
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
%{-e:%{error:The -N and -e options are mutually exclusive}}
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
%{-t:%{error:The -N and -t options are mutually exclusive}}
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
38ef5fb |
%{-e:%{expand:%global toxenv %(%{__python3} -s %{_rpmconfigdir}/redhat/pyproject_construct_toxenv.py %{?**})}}
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
5561755 |
echo 'python%{python3_pkgversion}-devel'
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
5561755 |
echo 'python%{python3_pkgversion}dist(pip) >= 19'
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
5561755 |
echo 'python%{python3_pkgversion}dist(packaging)'
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
%{!-N:if [ -f pyproject.toml ]; then
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
06b21e1 |
echo 'python%{python3_pkgversion}dist(toml)'
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
5b1caad |
elif [ -f setup.py ]; then
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ff39661 |
# Note: If the default requirements change, also change them in the script!
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ff39661 |
echo 'python%{python3_pkgversion}dist(setuptools) >= 40.8'
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ff39661 |
echo 'python%{python3_pkgversion}dist(wheel)'
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
5b1caad |
else
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
5b1caad |
echo 'ERROR: Neither pyproject.toml nor setup.py found, consider using %%%%pyproject_buildrequires -N <requirements-file> if this is not a Python package.' >&2
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
5b1caad |
exit 1
|
|
![](https://seccdn.libravatar.org/avatar/a973da034e49a14259bb98d71a1c60082c29ebcb91c4d7c9c8cb567099bad334?s=16&d=retro) |
d6ad9a7 |
fi}
|
|
![](https://seccdn.libravatar.org/avatar/46b4c9bf5302597e3a24dd27829c2ae9315b1f1ecdacf761f6b9ff14777f7b91?s=16&d=retro) |
bc156c4 |
# setuptools assumes no pre-existing dist-info
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
1026263 |
rm -rfv *.dist-info/ >&2
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
fdf5116 |
if [ -f %{__python3} ]; then
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
196bc90 |
RPM_TOXENV="%{toxenv}" HOSTNAME="rpmbuild" %{__python3} -s %{_rpmconfigdir}/redhat/pyproject_buildrequires.py %{?!_python_no_extras_requires:--generate-extras} --python3_pkgversion %{python3_pkgversion} %{?**}
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
162b0ca |
fi
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
162b0ca |
}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ec07317 |
|
|
![](https://seccdn.libravatar.org/avatar/f80a9d291ffd30761fe7b91001a2ff8b2668108b6abfaaea527ed437f1b415ea?s=16&d=retro) |
2800b49 |
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ec07317 |
%tox(e:) %{expand:\\\
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ec07317 |
TOX_TESTENV_PASSENV="${TOX_TESTENV_PASSENV:-*}" \\
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
32790ff |
PYTHONDONTWRITEBYTECODE=1 \\
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ec07317 |
PATH="%{buildroot}%{_bindir}:$PATH" \\
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ec07317 |
PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \\
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
5470f56 |
%{?__pytest_addopts:PYTEST_ADDOPTS="${PYTEST_ADDOPTS:-} %{__pytest_addopts}"} \\
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
37216e7 |
HOSTNAME="rpmbuild" \\
|
|
![](https://seccdn.libravatar.org/avatar/281c1b4f9e726ace8c183e703bc93493c3fdda6c6706c9b0eee00875216507d8?s=16&d=retro) |
cb8e334 |
%{__python3} -m tox --current-env -q --recreate -e "%{-e:%{-e*}}%{!-e:%{toxenv}}" %{?*}
|
|
![](https://seccdn.libravatar.org/avatar/3c06a168eac5e10baa83f960445b9b006df35865b76dcf7a899f6215ea86b54f?s=16&d=retro) |
ec07317 |
}
|