codeberg-cli: update to 0.4.6
[void-pkg.git] / common / build-style / python3-module.sh
blob8aec7a0e4590228c51120a7f81805450f429a4c3
2 # This helper is for templates installing python3-only modules.
5 do_build() {
6 python3 setup.py build ${make_build_args}
9 do_check() {
10 local testjobs
11 if python3 -c 'import pytest' >/dev/null 2>&1; then
12 if python3 -c 'import xdist' >/dev/null 2>&1; then
13 testjobs="-n $XBPS_MAKEJOBS"
15 PYTHONPATH="$(cd build/lib* && pwd)" PY_IGNORE_IMPORTMISMATCH=1 \
16 ${make_check_pre} \
17 python3 -m pytest ${testjobs} ${make_check_args} ${make_check_target}
18 else
19 # Fall back to deprecated setup.py test orchestration without pytest
20 if [ -z "$make_check_target" ]; then
21 if ! python3 setup.py --help test >/dev/null 2>&1; then
22 msg_warn "No command 'test' defined by setup.py.\n"
23 return 0
27 : ${make_check_target:=test}
28 ${make_check_pre} python3 setup.py ${make_check_target} ${make_check_args}
32 do_install() {
33 python3 setup.py install --prefix=/usr --root=${DESTDIR} ${make_install_args}