build-style/python3-pep517: use generic glob for wheels, refactor
Also: do not compile bytecode in `do_install()` since it will be removed in `post_install()`. Co-authored-by: Gonzalo Tornaría <tornaria@cmat.edu.uy> Co-authored-by: Andrew J. Hesford <ajh@sideband.org> Closes: #44071.
This commit is contained in:
parent
bdf30735d3
commit
126798875f
|
@ -9,35 +9,27 @@ do_build() {
|
|||
}
|
||||
|
||||
do_check() {
|
||||
local testjobs
|
||||
if python3 -c 'import pytest' >/dev/null 2>&1; then
|
||||
if python3 -c 'import xdist' >/dev/null 2>&1; then
|
||||
testjobs="-n $XBPS_MAKEJOBS"
|
||||
fi
|
||||
|
||||
if [ -z "${make_install_target}" ]; then
|
||||
local wheelbase="${pkgname#python3-}"
|
||||
make_install_target="dist/${wheelbase//-/_}-${version}-*-*-*.whl"
|
||||
fi
|
||||
|
||||
local testdir="${wrksrc}/tmp/$(date +%s)"
|
||||
python3 -m installer --destdir "${testdir}" \
|
||||
${make_install_args} ${make_install_target}
|
||||
|
||||
PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
|
||||
${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
|
||||
else
|
||||
msg_warn "Unable to determine tests for PEP517 Python templates\n"
|
||||
if ! python3 -c 'import pytest' >/dev/null 2>&1; then
|
||||
msg_warn "Testing of python3-pep517 templates requires pytest\n"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local testjobs
|
||||
if python3 -c 'import xdist' >/dev/null 2>&1; then
|
||||
testjobs="-n $XBPS_MAKEJOBS"
|
||||
fi
|
||||
|
||||
local testdir="${wrksrc}/tmp/$(date +%s)"
|
||||
python3 -m installer --destdir "${testdir}" \
|
||||
${make_install_args} ${make_install_target:-dist/*.whl}
|
||||
|
||||
PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
|
||||
${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
|
||||
}
|
||||
|
||||
do_install() {
|
||||
if [ -z "${make_install_target}" ]; then
|
||||
# Default wheel name normalizes hyphens to underscores
|
||||
local wheelbase="${pkgname#python3-}"
|
||||
make_install_target="dist/${wheelbase//-/_}-${version}-*-*-*.whl"
|
||||
fi
|
||||
: ${make_install_args:=--no-compile-bytecode}
|
||||
: ${make_install_target:="dist/*.whl"}
|
||||
|
||||
python3 -m installer --destdir ${DESTDIR} \
|
||||
${make_install_args} ${make_install_target}
|
||||
|
|
Loading…
Reference in New Issue