common/build-style/python3-pep517.sh: unpack wheels for testing
Python packages built with pep517 system occasionally require accessing distinfo files and/or entry points provided by the package for tests to run. Since these assets are packed inside the wheel generated in `do_build`, the target wheel is unpacked in `do_check` first so that the said artifacts are accessible during test runs.
This commit is contained in:
parent
836dad2cfa
commit
37d268a907
1 changed files with 12 additions and 1 deletions
|
@ -14,7 +14,18 @@ do_check() {
|
||||||
if python3 -c 'import xdist' >/dev/null 2>&1; then
|
if python3 -c 'import xdist' >/dev/null 2>&1; then
|
||||||
testjobs="-n $XBPS_MAKEJOBS"
|
testjobs="-n $XBPS_MAKEJOBS"
|
||||||
fi
|
fi
|
||||||
${make_check_pre} python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
|
|
||||||
|
if [ -z "${make_install_target}" ]; then
|
||||||
|
local wheelbase="${pkgname#python3-}"
|
||||||
|
make_install_target="dist/${wheelbase//-/_}-${version}-*-*-*.whl"
|
||||||
|
fi
|
||||||
|
|
||||||
|
local testdir="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
|
else
|
||||||
msg_warn "Unable to determine tests for PEP517 Python templates\n"
|
msg_warn "Unable to determine tests for PEP517 Python templates\n"
|
||||||
return 0
|
return 0
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue