It turned out easy to forget defining REQUIRED_USE when using the python-r1 eclass, see bug #530086. Would it be possible to add a repoman test that if python-r1 is inhereted a line defining REQUIRED_USE must be present in the ebuild? Thanks in advance!
I don't think REQUIRED_USE is strictly needed to be defined. Let's hear from the python team first. Michal, can we get feedback from you wearing both your python and QA hats please? especially since you coded the eclass to begin with ;)
I want that check for a long time, just have nobody with time to write it :P. I think the simplest solution is to grep REQUIRED_USE for existence of any python_targets* flags, and RDEPEND for existence of python_targets*? conditionals. This would cover python-r1 and python-single-r1. For python-any-r1, no REQUIRED_USE and python:X.Y (or jython, or pypy, or pypy3 :P) DEPEND check. We can also make it complain when python's in RDEPEND since that eclass is used for build-time use of Python only.
We may either a) hard-code-add distutils-r1 and gnome-python-common-r1 to the list of eclasses triggering these checks (due to inheriting from python-r1) or b) or to include all eclasses inheriting python-r1 dynamically. Or not? # grep -l "inherit.*python-r1" /usr/portage/eclass/*.eclass /usr/portage/eclass/distutils-r1.eclass /usr/portage/eclass/gnome-python-common-r1.eclass
(In reply to Sebastian Pipping from comment #3) > We may either > > a) hard-code-add distutils-r1 and gnome-python-common-r1 to > the list of eclasses triggering these checks > (due to inheriting from python-r1) or > > b) or to include all eclasses inheriting python-r1 > dynamically. > > Or not? I think the package metadata contains flattened list of used eclasses. Then you don't have to care what inherits python-r1 / python-single-r1 / python-any-r1 indirectly :).
*** Bug 472294 has been marked as a duplicate of this bug. ***
First, let's get summarize how different variables should look like and what can be expected. 1. PYTHON_DEPS 1a. python-r1: dev-lang/python-exec:= python_targets_pythonX_Y? ( >=dev-lang/python-X.Y.Z:X.Y[${PYTHON_REQ_USE}] ) 1b. python-single-r1: dev-lang/python-exec:= python_single_target_pythonX_Y? ( >=dev-lang/python-X.Y.Z:X.Y[${PYTHON_REQ_USE}] ) 1c. python-any-r1 || ( >=dev-lang/python-X.Y.Z:X.Y[${PYTHON_REQ_USE}] ) or if python_gen_any_dep is used: || ( ( >=dev-lang/python-X.Y.Z:X.Y[${PYTHON_REQ_USE}] dev-foo/bar[python_targets...] ) ) Notes: - some ebuilds needed to explicitly depend on python-exec to enforce a specific version, so we shouldn't rely on that too much. - We don't want to accidentally be happy about some stray '>=dev-lang/python-2.6' leftovers. - As seen above, in python-any-r1 it's legit to use $(python_gen_any_dep) without ${PYTHON_DEPS}. 2. REQUIRED_USE 2a. python-r1: || ( python_targets_python2_7 ... ) 2b. python-single-r1: python_single_target_python2_7? ( python_targets_python2_7 ) ^^ ( python_single_target_python2_7 ... ) Notes: - it would be nice not to catch custom 'doc? ( $(python_gen_useflags ...) )' while missing generic ${PYTHON_REQUIRED_USE}.
repoman support has been removed per bug 835013. Please file a new bug (or, I suppose, reopen this one) if you feel this check is still applicable to pkgcheck and doesn't already exist.
pkgcheck's PythonCheck includes this.