pkgcheck icon indicating copy to clipboard operation
pkgcheck copied to clipboard

Warn on invalid python_gen_any_dep in RDEPEND (bad python-r1/python-single-r1/distutils-r1 usage)

Open thesamesam opened this issue 3 years ago • 1 comments

At tree state d50f765c36427977a25bcf9e38ec5e3831aa2b0a, I saw a warning in CI for sys-block/fio:

3.27-r3 | PythonAnyMismatchedDepHasVersionCheck | DEPEND: missing check for dev-python/pandas[${PYTHON_USEDEP}] in 'python_gen_any_dep'
[...]

I checked it out and found that python_gen_any_dep was being used incorrectly in RDEPEND. I fixed this in commit https://github.com/gentoo/gentoo/commit/afe1d465ccc94cf7181309f5a2f7c59b5f8b2c18:

diff --git a/sys-block/fio/fio-3.27-r3.ebuild b/sys-block/fio/fio-3.27-r4.ebuild
similarity index 96%
rename from sys-block/fio/fio-3.27-r3.ebuild
rename to sys-block/fio/fio-3.27-r4.ebuild
index 7e2e9e4198ab..1a94d33a7c1a 100644
--- a/sys-block/fio/fio-3.27-r3.ebuild
+++ b/sys-block/fio/fio-3.27-r4.ebuild
@@ -48,7 +48,7 @@ DEPEND="${RDEPEND}
 RDEPEND+="
        python? (
                ${PYTHON_DEPS}
-               $(python_gen_any_dep 'dev-python/pandas[${PYTHON_USEDEP}]')
+               dev-python/pandas[${PYTHON_USEDEP}]
        )
        gnuplot? ( sci-visualization/gnuplot )"

@@ -60,10 +60,6 @@ PATCHES=(
        "${FILESDIR}"/fio-3.27-drop-raw.patch
 )

-python_check_deps() {
-       has_version "dev-python/pandas[${PYTHON_USEDEP}]"
-}
-
 src_prepare() {
        default

diff --git a/sys-block/fio/fio-3.30.ebuild b/sys-block/fio/fio-3.30-r1.ebuild
similarity index 96%
rename from sys-block/fio/fio-3.30.ebuild
rename to sys-block/fio/fio-3.30-r1.ebuild
index c5fa566adf93..e132b2991d2d 100644
--- a/sys-block/fio/fio-3.30.ebuild
+++ b/sys-block/fio/fio-3.30-r1.ebuild
@@ -49,7 +49,7 @@ DEPEND="${RDEPEND}
 RDEPEND+="
        python? (
                ${PYTHON_DEPS}
-               $(python_gen_any_dep 'dev-python/pandas[${PYTHON_USEDEP}]')
+               dev-python/pandas[${PYTHON_USEDEP}]
        )
        gnuplot? ( sci-visualization/gnuplot )"

@@ -59,10 +59,6 @@ PATCHES=(
        "${FILESDIR}"/fio-2.2.13-libmtd.patch
 )

-python_check_deps() {
-       has_version "dev-python/pandas[${PYTHON_USEDEP}]"
-}
-
 src_prepare() {
        default

While I noticed the problem because of PythonAnyMismatchedDepHasVersionCheck, it's technically not the right warning, but thinking about it, it might cover all cases already (i.e. such invalid use might always fire PythonAnyMismatchedDepHasVersionCheck), in which case, this is simply a cosmetic issue, and I don't really care about it (pkgcheck is doing its job and finding a problem, the exact name doesn't matter, and it's not wrong here).

Are there cases I'm missing?

thesamesam avatar Oct 18 '22 02:10 thesamesam