diff options
author | Matt Whitlock <gentoo@mattwhitlock.name> | 2022-03-18 17:44:05 -0400 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2023-08-19 20:28:11 +0200 |
commit | f80b0acf7f78971b601aabb913e067a0dde70268 (patch) | |
tree | e906b53a56f34f7a7f7083a5c42c2ac6f8f9b1a7 /eclass/python-r1.eclass | |
parent | dev-python/nbconvert: Remove old (diff) | |
download | gentoo-f80b0acf7f78971b601aabb913e067a0dde70268.tar.gz gentoo-f80b0acf7f78971b601aabb913e067a0dde70268.tar.bz2 gentoo-f80b0acf7f78971b601aabb913e067a0dde70268.zip |
python{,-any}-r1.eclass: use python_has_version in examples
The python_check_deps() examples given in the documentation of several
functions and variables in python-r1.eclass and python-any-r1.eclass are
incorrect. The default behavior of has_version() is to check the
*runtime* system (RDEPEND), but python_check_deps() is meant to check
that the *build* system (BDEPEND) has a suitable Python environment. The
examples fail to do this and thus likely are leading developers to write
incorrect python_check_deps() functions in their ebuilds. Thankfully,
python-utils-r1.eclass supplies a python_has_version() function that
defaults to checking the build system and implements some other
enhancements that make it nicer for use in python_check_deps(). Change
the examples to use python_has_version.
Closes: https://bugs.gentoo.org/835462
Signed-off-by: Matt Whitlock <gentoo@mattwhitlock.name>
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-r1.eclass')
-rw-r--r-- | eclass/python-r1.eclass | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass index b816e3b6f855..303737e41589 100644 --- a/eclass/python-r1.eclass +++ b/eclass/python-r1.eclass @@ -156,7 +156,7 @@ inherit multibuild python-utils-r1 # Example use: # @CODE # python_check_deps() { -# has_version "dev-python/bar[${PYTHON_SINGLE_USEDEP}]" +# python_has_version "dev-python/bar[${PYTHON_SINGLE_USEDEP}]" # } # @CODE # @@ -474,9 +474,9 @@ python_gen_impl_dep() { # dev-python/baz[${PYTHON_USEDEP}] )' -2)" # # python_check_deps() { -# has_version "dev-python/foo[${PYTHON_SINGLE_USEDEP}]" \ -# && { has_version "dev-python/bar[${PYTHON_USEDEP}]" \ -# || has_version "dev-python/baz[${PYTHON_USEDEP}]"; } +# python_has_version "dev-python/foo[${PYTHON_SINGLE_USEDEP}]" && +# { python_has_version "dev-python/bar[${PYTHON_USEDEP}]" || +# python_has_version "dev-python/baz[${PYTHON_USEDEP}]"; } # } # # src_compile() { @@ -692,7 +692,7 @@ python_foreach_impl() { # $(python_gen_any_dep 'dev-python/epydoc[${PYTHON_USEDEP}]' 'python2*') )" # # python_check_deps() { -# has_version "dev-python/epydoc[${PYTHON_USEDEP}]" +# use !doc || python_has_version "dev-python/epydoc[${PYTHON_USEDEP}]" # } # # src_compile() { |