2020-12-03 04:20:18 +01:00
|
|
|
#
|
|
|
|
# This style is for templates installing python3 modules adhering to PEP517
|
|
|
|
#
|
|
|
|
|
|
|
|
do_build() {
|
|
|
|
: ${make_build_target:=.}
|
2022-11-08 17:48:04 +01:00
|
|
|
: ${make_build_args:=--no-isolation --wheel}
|
|
|
|
python3 -m build ${make_build_args} ${make_build_target}
|
2020-12-03 04:20:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do_check() {
|
2022-05-14 21:23:13 +02:00
|
|
|
local testjobs
|
2021-06-08 05:41:26 +02:00
|
|
|
if python3 -c 'import pytest' >/dev/null 2>&1; then
|
2022-05-14 21:23:13 +02:00
|
|
|
if python3 -c 'import xdist' >/dev/null 2>&1; then
|
|
|
|
testjobs="-n $XBPS_MAKEJOBS"
|
|
|
|
fi
|
|
|
|
${make_check_pre} python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
|
2020-12-03 04:20:18 +01:00
|
|
|
else
|
2022-11-10 01:27:52 +01:00
|
|
|
msg_warn "Unable to determine tests for PEP517 Python templates\n"
|
2020-12-03 04:20:18 +01:00
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2022-05-16 16:26:50 +02:00
|
|
|
if [ -z "${make_install_target}" ]; then
|
|
|
|
# Default wheel name normalizes hyphens to underscores
|
|
|
|
local wheelbase="${pkgname#python3-}"
|
2022-11-08 17:48:04 +01:00
|
|
|
make_install_target="dist/${wheelbase//-/_}-${version}-*-*-*.whl"
|
2022-05-16 16:26:50 +02:00
|
|
|
fi
|
2020-12-03 04:20:18 +01:00
|
|
|
|
2022-11-08 17:48:04 +01:00
|
|
|
python3 -m installer --destdir ${DESTDIR} \
|
|
|
|
${make_install_args} ${make_install_target}
|
2020-12-03 04:20:18 +01:00
|
|
|
}
|