2020-12-03 04:20:18 +01:00
|
|
|
#
|
|
|
|
# This style is for templates installing python3 modules adhering to PEP517
|
|
|
|
#
|
|
|
|
|
|
|
|
do_build() {
|
|
|
|
: ${make_build_target:=.}
|
2023-09-21 17:01:24 +02:00
|
|
|
|
|
|
|
if [ "${CROSS_BUILD}" ] && [[ "${build_helper}" = *meson* ]]; then
|
|
|
|
local mcross="-Csetup-args=--cross-file=${XBPS_WRAPPERDIR}/meson"
|
|
|
|
make_build_args+=" ${mcross}/xbps_meson.cross"
|
|
|
|
|
|
|
|
if [[ "${build_helper}" = *numpy* ]]; then
|
|
|
|
make_build_args+=" ${mcross}/xbps_numpy.cross"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
python3 -m build --no-isolation --wheel \
|
|
|
|
${make_build_args} ${make_build_target}
|
2020-12-03 04:20:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do_check() {
|
2023-05-25 00:51:18 +02:00
|
|
|
if ! python3 -c 'import pytest' >/dev/null 2>&1; then
|
|
|
|
msg_warn "Testing of python3-pep517 templates requires pytest\n"
|
|
|
|
return 0
|
|
|
|
fi
|
2023-02-01 06:46:05 +01:00
|
|
|
|
2023-05-25 00:51:18 +02:00
|
|
|
local testjobs
|
|
|
|
if python3 -c 'import xdist' >/dev/null 2>&1; then
|
|
|
|
testjobs="-n $XBPS_MAKEJOBS"
|
|
|
|
fi
|
2023-02-01 06:46:05 +01:00
|
|
|
|
2023-05-25 21:13:08 +02:00
|
|
|
local testdir="${wrksrc}/.xbps-testdir/$(date +%s)"
|
2023-05-25 00:51:18 +02:00
|
|
|
python3 -m installer --destdir "${testdir}" \
|
|
|
|
${make_install_args} ${make_install_target:-dist/*.whl}
|
2023-02-01 06:46:05 +01:00
|
|
|
|
2023-05-25 00:51:18 +02:00
|
|
|
PATH="${testdir}/usr/bin:${PATH}" PYTHONPATH="${testdir}/${py3_sitelib}" \
|
|
|
|
${make_check_pre} pytest3 ${testjobs} ${make_check_args} ${make_check_target}
|
2020-12-03 04:20:18 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
2023-05-25 00:51:18 +02:00
|
|
|
: ${make_install_args:=--no-compile-bytecode}
|
|
|
|
: ${make_install_target:="dist/*.whl"}
|
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
|
|
|
}
|