2020-12-03 04:20:18 +01:00
|
|
|
#
|
|
|
|
# This style is for templates installing python3 modules adhering to PEP517
|
|
|
|
#
|
|
|
|
|
|
|
|
do_build() {
|
|
|
|
# No PEP517 build tool currently supports compiled extensions
|
|
|
|
# Thus, there is no need to accommodate cross compilation here
|
|
|
|
: ${make_build_target:=.}
|
|
|
|
|
|
|
|
mkdir -p build
|
|
|
|
TMPDIR=build python3 -m pip wheel --no-deps --use-pep517 --no-clean \
|
|
|
|
--no-build-isolation ${make_build_args} ${make_build_target}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
msg_warn "Unable to determine tests for PEP517 Python templates"
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
do_install() {
|
|
|
|
# As with do_build, no need to accommodate cross compilation here
|
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-}"
|
|
|
|
make_install_target="${wheelbase//-/_}-${version}-*-*-*.whl"
|
|
|
|
fi
|
2020-12-03 04:20:18 +01:00
|
|
|
|
2021-02-03 22:24:49 +01:00
|
|
|
# If do_build was overridden, make sure the TMPDIR exists
|
|
|
|
mkdir -p build
|
2020-12-03 04:20:18 +01:00
|
|
|
TMPDIR=build python3 -m pip install --use-pep517 --prefix /usr \
|
|
|
|
--root ${DESTDIR} --no-deps --no-build-isolation \
|
|
|
|
--no-clean ${make_install_args} ${make_install_target}
|
|
|
|
}
|