Add a handy `--unpack` option to pypi_wheel_url, that automatically
renames the downloaded distfile to have .zip suffix. This is used
e.g. in dev-python/installer and dev-python/tomli to have
default_src_unpack unpack the wheels automatically.
Signed-off-by: Michał Górny <
mgorny@gentoo.org>
---
eclass/pypi.eclass | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/eclass/pypi.eclass b/eclass/pypi.eclass
index e11999fc7e9c..ea57b2345502 100644
--- a/eclass/pypi.eclass
+++ b/eclass/pypi.eclass
@@ -89,10 +89,16 @@ pypi_wheel_name() {
}
# @FUNCTION: pypi_wheel_url
-# @USAGE: [<project> [<version> [<python-tag> [<abi-platform-tag>]]]]
+# @USAGE: [--unpack] [<project> [<version> [<python-tag> [<abi-platform-tag>]]]]
# @DESCRIPTION:
# Output the URL to PyPI wheel for specified project/version tuple.
#
+# The `--unpack` option causes a SRC_URI with an arrow operator to
+# be generated, that adds a .zip suffix to the fetched distfile,
+# so that it is unpacked in default src_unpack(). Note that
+# the wheel contents will be unpacked straight into ${WORKDIR}.
+# You need to add a BDEPEND on app-arch/unzip.
+#
# If <package> is unspecified, it defaults to ${PN}.
#
# If <version> is unspecified, it defaults to ${PV}.
@@ -103,21