Skip to content

Commit ada7d18

Browse files
classabbyampahesford
authored andcommitted
common/hooks/pre-pkg/06-verify-python-deps: add hook
compares rdeps and Python module metadata to find missing dependencies for python packages. this uses virtual packages to map python canonical package names to void packages.
1 parent 232221e commit ada7d18

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# vim: set ts=4 sw=4 et:
2+
#
3+
# This hook executes the following tasks:
4+
# - Verifies python module dependencies from dist-info's METADATA and egg-info's PKG-INFO
5+
6+
hook() {
7+
local py3_bin="${XBPS_MASTERDIR}/usr/bin/python3"
8+
9+
if [ -z "$nopyprovides" ] && [ -d "${PKGDESTDIR}/${py3_sitelib}" ] && [ -x "${py3_bin}" ]; then
10+
PYTHONPATH="${XBPS_MASTERDIR}/${py3_sitelib}-bootstrap" "${py3_bin}" \
11+
"${XBPS_COMMONDIR}"/scripts/parse-py-metadata.py \
12+
${NOCOLORS:+-C} ${XBPS_STRICT:+-s} -S "${PKGDESTDIR}/${py3_sitelib}" -v "${pkgver}" \
13+
depends -e "${python_extras}" \
14+
-V <( $XBPS_QUERY_XCMD -R -p provides -s "py3:" ) -D "${XBPS_STATEDIR}/${pkgname}-rdeps" \
15+
|| msg_error "$pkgver: failed to verify python module dependencies\n"
16+
fi
17+
}

0 commit comments

Comments
 (0)