diff options
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/Manifest.gz | bin | 37644 -> 37639 bytes | |||
-rw-r--r-- | eclass/distutils-r1.eclass | 45 | ||||
-rw-r--r-- | eclass/python-utils-r1.eclass | 7 |
3 files changed, 43 insertions, 9 deletions
diff --git a/eclass/Manifest.gz b/eclass/Manifest.gz Binary files differindex 6fe25d702a41..ae2cf9ae6352 100644 --- a/eclass/Manifest.gz +++ b/eclass/Manifest.gz 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 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index d21e54c6ecc9..40792714cc56 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1344,7 +1344,12 @@ eunittest() { _python_check_EPYTHON - set -- "${EPYTHON}" -m unittest_or_fail discover -v "${@}" + # unittest fails with "no tests" correctly since Python 3.12 + local runner=unittest + if _python_impl_matches "${EPYTHON}" 3.{9..11}; then + runner=unittest_or_fail + fi + set -- "${EPYTHON}" -m "${runner}" discover -v "${@}" echo "${@}" >&2 "${@}" || die -n "Tests failed with ${EPYTHON}" |