summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-02-05 13:06:56 +0100
committerMichał Górny <mgorny@gentoo.org>2022-02-09 09:43:40 +0100
commit2fcd67da826b1c9cf81306cbad6bf6924ded2b6d (patch)
tree1f5d59fbbd17814c05790f7e265c3c7e1652ff45 /eclass/distutils-r1.eclass
parentdistutils-r1.eclass: Split backend getting code into a function (diff)
downloadgentoo-2fcd67da826b1c9cf81306cbad6bf6924ded2b6d.tar.gz
gentoo-2fcd67da826b1c9cf81306cbad6bf6924ded2b6d.tar.bz2
gentoo-2fcd67da826b1c9cf81306cbad6bf6924ded2b6d.zip
distutils-r1.eclass: Get wheel name from the backend
Use the wheel name returned by build_wheel() rather than trying to guess it from WHEEL_DIR. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass14
1 files changed, 5 insertions, 9 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 81eea83c67b3..ef7bea8d36fa 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1032,22 +1032,18 @@ distutils-r1_python_compile() {
local build_backend=$(_distutils-r1_get_backend)
einfo " Building the wheel via ${build_backend}"
- "${EPYTHON}" -c "import ${build_backend%:*}; \
+ local wheel=$("${EPYTHON}" -c "import ${build_backend%:*}; \
import os; \
- ${build_backend/:/.}.build_wheel(os.environ['WHEEL_BUILD_DIR'])" ||
- die "Wheel build failed"
-
- local wheel=( "${WHEEL_BUILD_DIR}"/*.whl )
- if [[ ${#wheel[@]} -ne 1 ]]; then
- die "Incorrect number of wheels created (${#wheel[@]}): ${wheel[*]}"
- fi
+ print(${build_backend/:/.}.build_wheel(os.environ['WHEEL_BUILD_DIR']), \
+ file=os.fdopen(3, 'w'))" 3>&1 >&2 || die "Wheel build failed")
+ [[ -n ${wheel} ]] || die "No wheel name returned"
local root=${BUILD_DIR}/install
einfo " Installing the wheel to ${root}"
# NB: --compile-bytecode does not produce the correct paths,
# and python_optimize doesn't handle being called outside D,
# so we just defer compiling until the final merge
- "${EPYTHON}" -m installer -d "${root}" "${wheel}" \
+ "${EPYTHON}" -m installer -d "${root}" "${WHEEL_BUILD_DIR}/${wheel}" \
--no-compile-bytecode ||
die "installer failed"