From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BC056158451 for ; Mon, 8 Jan 2024 14:48:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7ADD12BC041; Mon, 8 Jan 2024 14:48:34 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5AD222BC041 for ; Mon, 8 Jan 2024 14:48:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 74A37343336 for ; Mon, 8 Jan 2024 14:48:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B578314BE for ; Mon, 8 Jan 2024 14:48:30 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1704725301.840cd24f4adc643b949f8e45d17ab3f7dc5347fc.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: metadata/install-qa-check.d/ X-VCS-Repository: repo/gentoo X-VCS-Files: metadata/install-qa-check.d/60python-site X-VCS-Directories: metadata/install-qa-check.d/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 840cd24f4adc643b949f8e45d17ab3f7dc5347fc X-VCS-Branch: master Date: Mon, 8 Jan 2024 14:48:30 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 6e73db8b-578d-4ecf-9582-7fdde0075b5a X-Archives-Hash: 6e674e7e6731f214d968dd05f42ce7fa commit: 840cd24f4adc643b949f8e45d17ab3f7dc5347fc Author: Michał Górny gentoo org> AuthorDate: Fri Jan 5 16:48:14 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon Jan 8 14:48:21 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=840cd24f install-qa-check.d/60python-site: Check for out-of-sitepkg install Signed-off-by: Michał Górny gentoo.org> metadata/install-qa-check.d/60python-site | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/metadata/install-qa-check.d/60python-site b/metadata/install-qa-check.d/60python-site index 323539107900..00962b0448b0 100644 --- a/metadata/install-qa-check.d/60python-site +++ b/metadata/install-qa-check.d/60python-site @@ -31,6 +31,7 @@ python_site_check() { local stray=() local bad_versions=() + local outside_site=() local stray_packages=() # Avoid running the check if sufficiently new gpep517 is not installed @@ -46,7 +47,24 @@ python_site_check() { impl=${impl##*/} # NB: using ${impl}* to catch pypy3.* for pypy3 - local sitedir=( "${ED}"/usr/lib/${impl}*/site-packages ) + local pydir=( "${ED}"/usr/lib/${impl}* ) + [[ -d ${pydir} ]] || continue + + # check for packages installing outside site-packages + case ${CATEGORY}/${PN} in + dev-lang/python|dev-python/pypy*) + ;; + *) + while IFS= read -d $'\0' -r f; do + outside_site+=( "${f}" ) + done < <( + find "${pydir}" -mindepth 1 -maxdepth 1 \ + '!' -name site-packages -print0 + ) + ;; + esac + + local sitedir=( "${pydir}"/site-packages ) [[ -d ${sitedir} ]] || continue # check for bad package versions @@ -197,6 +215,14 @@ python_site_check() { eqawarn eqatag -v python-site.libdir "${bad_libdirs[@]#${ED}}" fi + + if [[ ${outside_site[@]} ]]; then + eqawarn + eqawarn "QA Notice: Files found installed directly into Python stdlib," + eqawarn "instead of site-packages (use \$(python_get_sitedir)):" + eqawarn + eqatag -v python-site.stdlib "${outside_site[@]}" + fi } python_site_check