From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Jun 4 11:10:02 2022
Hi,
Here's another large-ish patchset for the Python eclass. The primary
highlight is DISTUTILS_USE_PEP517=no mode explained below. In addition
to that, some refactoring, bug fixes and other changes collected
to avoid updating the metadata cache twice.
D_U_PEP517=no mode basically gives you the best of distutils-r1 features without default python_* phases or build system-specific dependencies.
This means to cover 3 use cases:
1) packages that can't use PEP517 to avoid cyclic deps in bootstrap,
2) trivial packages without a build system,
3) Python-ish packages without a PEP517 build system (e.g. using plain
meson).
Before, these either required legacy mode (that I'd like to eventually
remove, many years from now) or using python-r1 directly. Thanks to
the new mode, they can benefit from convenient python_* phases, default
Python deps (unless you're using DISTUTILS_OPTIONAL), the test-scope
venv logic, distutils_enable_tests, etc.
There are two main methods of using it: either declare phases up to python_install() and install files straight to ${D}, or install them
to ${BUILD_DIR}/install during python_compile() and the eclass will pick
it up. The latter method gives you working venv for python_test() too.
I've included a few example ebuilds in the middle of patch set. tomli
and installer ebuilds demonstrate using python_compile() to install
Python modules and use them in tests. gpep517 uses python_install(). gnome-abrt demonstrates working with meson (yes, I know it's the old
version).
Other changes are:
- removing incidental install of temporary cache files (*-pytest-*.pyc)
from epytest
- internal refactoring to make post-python_install() QA checks,
${BUILD_DIR}/install merging and post-python_compile() test venv setup
(in PEP517 mode) work independently of python_compile()
and python_install() overrides
- *-nspkg.pth warning will become an error in EAPI 9
- python_domodule() now works outside src_install(), by installing
into ${BUILD_DIR}/install (and therefore fits part with distutils-r1)
- other python_do*() and python_new*() functions now fail if called
outside src_install()
- add `_trial_temp` to disallowed top-level packages
- minor doc fixes
--
Best regards,
Michał Górny
Arthur Zamarin (2):
python-any-r1.eclass: use python_has_version in examples
distutils-r1.eclass: small docs format fixes
Michał Górny (16):
python-utils-r1.eclass: Strip stray *-pytest-*.pyc files in epytest
distutils-r1.eclass: Support internal post-python_* phase functions
distutils-r1.eclass: Call egg-info cleanup via post-test phase
distutils-r1.eclass: Move install QA checks to post-phase function
distutils-r1.eclass: Remove the obsolete pypy/share check
distutils-r1.eclass: Make *-nspkg.pth warning fatal for EAPI 9+
distutils-r1.eclass: Move venv/merge-root logic to post-phases
distutils-r1.eclass: Introduce DISTUTILS_USE_PEP517=no mode
python-utils-r1.eclass: Fix typo in python_moduleinto doc
python-utils-r1.eclass: Support python_domodule outside src_install
python-utils-r1.eclass: Add explicit checks for incorrect phase
dev-python/tomli: Use DISTUTILS_USE_PEP517=no
dev-python/installer: Use DISTUTILS_USE_PEP517=no
dev-python/gpep517: Use DISTUTILS_USE_PEP517=no
app-admin/gnome-abrt: Use DISTUTILS_USE_PEP517=no
distutils-r1.eclass: Add "_trial_temp" to forbidden package names