mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 14:36:58 +02:00
eclass/distutils-r1: Sync with Gentoo
It's from Gentoo commit 2e9c80d0b20108082ee81e5c07b3779a6ddb9074.
This commit is contained in:
parent
b3af7f152c
commit
5beec2121a
@ -608,18 +608,28 @@ distutils_enable_tests() {
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner"
|
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner"
|
||||||
local test_pkg
|
|
||||||
|
local test_deps=${RDEPEND}
|
||||||
|
local test_pkgs
|
||||||
case ${1} in
|
case ${1} in
|
||||||
nose)
|
nose)
|
||||||
test_pkg=">=dev-python/nose-1.3.7_p20221026"
|
test_pkgs='>=dev-python/nose-1.3.7_p20221026[${PYTHON_USEDEP}]'
|
||||||
;;
|
;;
|
||||||
pytest)
|
pytest)
|
||||||
test_pkg=">=dev-python/pytest-7.3.1"
|
test_pkgs='>=dev-python/pytest-7.3.1[${PYTHON_USEDEP}]'
|
||||||
|
if [[ ${EPYTEST_XDIST} ]]; then
|
||||||
|
test_pkgs+=' dev-python/pytest-xdist[${PYTHON_USEDEP}]'
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
setup.py)
|
setup.py)
|
||||||
;;
|
;;
|
||||||
unittest)
|
unittest)
|
||||||
# dep handled below
|
# unittest-or-fail is needed in py<3.12
|
||||||
|
test_deps+="
|
||||||
|
$(python_gen_cond_dep '
|
||||||
|
dev-python/unittest-or-fail[${PYTHON_USEDEP}]
|
||||||
|
' 3.10 3.11)
|
||||||
|
"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
die "${FUNCNAME}: unsupported argument: ${1}"
|
die "${FUNCNAME}: unsupported argument: ${1}"
|
||||||
@ -628,22 +638,14 @@ distutils_enable_tests() {
|
|||||||
_DISTUTILS_TEST_RUNNER=${1}
|
_DISTUTILS_TEST_RUNNER=${1}
|
||||||
python_test() { distutils-r1_python_test; }
|
python_test() { distutils-r1_python_test; }
|
||||||
|
|
||||||
local test_deps=${RDEPEND}
|
if [[ -n ${test_pkgs} ]]; then
|
||||||
if [[ -n ${test_pkg} ]]; then
|
|
||||||
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
|
if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
|
||||||
test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]"
|
test_deps+=" ${test_pkgs//'${PYTHON_USEDEP}'/${PYTHON_USEDEP}}"
|
||||||
else
|
else
|
||||||
test_deps+=" $(python_gen_cond_dep "
|
test_deps+=" $(python_gen_cond_dep "
|
||||||
${test_pkg}[\${PYTHON_USEDEP}]
|
${test_pkgs}
|
||||||
")"
|
")"
|
||||||
fi
|
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
|
fi
|
||||||
if [[ -n ${test_deps} ]]; then
|
if [[ -n ${test_deps} ]]; then
|
||||||
IUSE+=" test"
|
IUSE+=" test"
|
||||||
@ -1811,6 +1813,9 @@ distutils-r1_run_phase() {
|
|||||||
local -x CYTHON_FORCE_REGEN=1
|
local -x CYTHON_FORCE_REGEN=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# silence warnings when pydevd is loaded on Python 3.11+
|
||||||
|
local -x PYDEVD_DISABLE_FILE_VALIDATION=1
|
||||||
|
|
||||||
# Rust extensions are incompatible with C/C++ LTO compiler
|
# Rust extensions are incompatible with C/C++ LTO compiler
|
||||||
# see e.g. https://bugs.gentoo.org/910220
|
# see e.g. https://bugs.gentoo.org/910220
|
||||||
if has cargo ${INHERITED}; then
|
if has cargo ${INHERITED}; then
|
||||||
|
Loading…
Reference in New Issue
Block a user