From 456fc832c996a122c45240beb68820ab3c2ada40 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 23 May 2023 21:00:11 +0100 Subject: gentoo auto-resync : 23:05:2023 - 21:00:10 --- eclass/distutils-r1.eclass | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'eclass/distutils-r1.eclass') 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 '