Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[New Check]: Detect misplacement of distutils_enable_sphinx and distutils_enable_tests #660

Open
1 task done
mgorny opened this issue Feb 1, 2024 · 0 comments
Open
1 task done
Labels

Comments

@mgorny
Copy link
Contributor

mgorny commented Feb 1, 2024

Is there an existing such new check request for this?

  • I have searched the existing issues

Explain

We should detect that the distutils_enable_sphinx and distutils_enable_tests are called in the correct location, that is:

  1. That BDEPEND, IUSE, RESTRICT aren't overrode after the call (but it's fine to += them).
  2. That they are called prior to declaring phase functions (possibly any functions?).

Examples

gentoo/gentoo@94f4934 is a typical case of fixing the wrong order.

gentoo/gentoo@9bc4894 has distutils_enable_tests after phase function, along with EPYTEST_DESELECT that's so huge that I didn't even notice src_prepare() there at all.

Output message

should be called after declaring // should be called prior to declaring ebuild functions

Documentation

distutils_enable_sphinx and distutils_enable_tests variables modify ebuild metadata and declare sub-phase functions. They should be called after assigning metadata variables (such as BDEPEND) to prevent their results from being overwritten; it is valid to append to these variables after the call, though. They should be called before defining ebuild functions (such as python_test), as otherwise they could overwrite them.

Result level

warning

@mgorny mgorny added the check label Feb 1, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant