summaryrefslogtreecommitdiff
path: root/eclass/distutils-r1.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-05-23 21:00:11 +0100
committerV3n3RiX <venerix@koprulu.sector>2023-05-23 21:00:11 +0100
commit456fc832c996a122c45240beb68820ab3c2ada40 (patch)
tree947c249e75095705ddfd9e3dbb77e7b0b47bf915 /eclass/distutils-r1.eclass
parent764cacf515464f89b60c94a29b3b7262479feb22 (diff)
gentoo auto-resync : 23:05:2023 - 21:00:10
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass45
1 files changed, 37 insertions, 8 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index f4ef89ee792e..ec1dd08b197c 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -605,7 +605,7 @@ distutils_enable_tests() {
setup.py)
;;
unittest)
- test_pkg="dev-python/unittest-or-fail"
+ # dep handled below
;;
*)
die "${FUNCNAME}: unsupported argument: ${1}"
@@ -623,6 +623,13 @@ distutils_enable_tests() {
${test_pkg}[\${PYTHON_USEDEP}]
")"
fi
+ elif [[ ${1} == unittest ]]; then
+ # unittest-or-fail is needed in py<3.12
+ test_deps+="
+ $(python_gen_cond_dep '
+ dev-python/unittest-or-fail[${PYTHON_USEDEP}]
+ ' 3.{9..11})
+ "
fi
if [[ -n ${test_deps} ]]; then
IUSE+=" test"
@@ -1318,6 +1325,28 @@ distutils_pep517_install() {
local config_settings=
case ${DISTUTILS_USE_PEP517} in
+ maturin)
+ # ebuild's DISTUTILS_ARGS are currently ignored if <1.0.0, ebuilds
+ # should set the dependency if used until this can be cleaned up
+ # (reminder to cleanup the old MATURIN_PEP517_ARGS block too)
+ if has_version -b '>=dev-util/maturin-1.0.0'; then
+ # `maturin pep517 build-wheel --help` for options
+ local maturin_args=(
+ "${DISTUTILS_ARGS[@]}"
+ --jobs="$(makeopts_jobs)"
+ --skip-auditwheel # see bug #831171
+ $(in_iuse debug && usex debug '--profile=dev' '')
+ )
+
+ config_settings=$(
+ "${EPYTHON}" - "${maturin_args[@]}" <<-EOF || die
+ import json
+ import sys
+ print(json.dumps({"build-args": sys.argv[1:]}))
+ EOF
+ )
+ fi
+ ;;
meson-python)
local -x NINJAOPTS=$(get_NINJAOPTS)
if has_version -b '>=dev-python/meson-python-0.13'; then
@@ -1493,13 +1522,13 @@ distutils-r1_python_compile() {
fi
;;
maturin)
- # auditwheel may auto-bundle libraries (bug #831171),
- # also support cargo.eclass' IUSE=debug if available
- local -x MATURIN_PEP517_ARGS="
- --jobs=$(makeopts_jobs)
- --skip-auditwheel
- $(in_iuse debug && usex debug --profile=dev '')
- "
+ if has_version -b '<dev-util/maturin-1.0.0'; then
+ local -x MATURIN_PEP517_ARGS="
+ --jobs=$(makeopts_jobs)
+ --skip-auditwheel
+ $(in_iuse debug && usex debug --profile=dev '')
+ "
+ fi
;;
no)
return