• [gentoo-dev] [PATCH 00/11] distutils-r1.eclass: Support for gpep517-9+

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Fri Jul 29 12:40:02 2022
    Hi,

    Here's another medium-sized patchset for Python eclasses. The primary
    feature is support for the new gpep517 9+ option to byte-compile
    installed .pyc files. As a result, rather than delaying until python_install(), we get optimized .pyc already in python_compile()
    and the test phase should be faster.

    This implies a minor change to DISTUTILS_USE_PEP517=no behavior -- we're
    no longer calling python_optimize implicitly, so if the ebuild does not
    compile bytecode, it needs to call python_optimize explicitly now.
    This mode is used only by a few ebuilds right now, so I'm including
    updates to them as well. On the plus side, it now avoids compiling .py
    files twice in the remaining ebuilds.

    The other major change included is rewriting the .pyc install-qa-check.d
    to use the new "gpep517 verify-pyc" command rather than implementing
    the checks in bash. Since gpep517 is a dep of all ebuilds inheriting distutils-r1, this should be a relatively safe place to put
    the functionality, and so the check should work reliably in most
    of the environments. This also includes more correct checking of
    whether .pyc files are up-to-date that couldn't be done in bash because
    it impacted performance *a lot*.

    The other changes include a fix for obsolete pyproject.toml
    recommendation, the usual build system minimal version updates,
    disabling pytest-sugar plugin in epytest (that makes test output awful)
    and fixing EPREFIX in addpredict invocations.


    Michał Górny (11):
    distutils-r1.eclass: Update pyproject.toml advice for PEP517 mode
    distutils-r1.eclass: Require gpep517 >= 8
    install-qa-check.d: Rewrite 60python-pyc to use gpep517
    distutils-r1.eclass: Bump dev-python/sip dependency
    distutils-r1.eclass: Pass EPREFIX to addpredict
    distutils-r1.eclass: Let gpep517 compile bytecode when 9+ is used
    dev-python/installer: Call python_optimize explicitly
    dev-python/tomli: Call python_optimize explicitly
    net-wireless/blueman: Invoke eautomake to fix py-compile script
    dev-python/pygobject: Call python_optimize explicitly
    python-utils-r1.eclass: Sterilize pytest-sugar plugin

    .../installer/installer-0.5.1-r1.ebuild | 5 +
    dev-python/pygobject/pygobject-3.42.2.ebuild | 1 +
    dev-python/tomli/tomli-2.0.1-r1.ebuild | 5 +
    eclass/distutils-r1.eclass | 52 ++++--
    eclass/python-utils-r1.eclass | 3 +
    metadata/install-qa-check.d/60python-pyc | 168 ++++++++++--------
    net-wireless/blueman/blueman-2.3.1.ebuild | 2 +-
    net-wireless/blueman/blueman-9999.ebuild | 2 +-
    8 files changed, 146 insertions(+), 92 deletions(-)

    --
    2.35.1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Fri Jul 29 12:40:02 2022
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    metadata/install-qa-check.d/60python-pyc | 168 +++++++++++++----------
    1 file changed, 96 insertions(+), 72 deletions(-)

    diff --git a/metadata/install-qa-check.d/60python-pyc b/metadata/install-qa-check.d/60python-pyc
    index 47e9a3eea908..fd9434994f2f 100644
    --- a/metadata/install-qa-check.d/60python-pyc
    +++ b/metadata/install-qa-check.d/60python-pyc
    @@ -4,86 +4,110 @@
    # QA check: ensure that Python modules are compiled after installing
    # Maintainer: Python project <python@gentoo.org>

    -# EAPI guard to prevent errors from trying to import python-utils-r1
    -# in unsupported EAPIs. Please keep the list in sync with the eclass!
    -if [[ ${EAPI} == [6-8] ]]; then
    - inherit python-utils-r1
    +python_pyc_check() {
    + local save=$(shopt -p nullglob)
    + shopt -s nullglob
    + local progs=( "${EPREFIX}"/usr/lib/python-exec/*/gpep517 )
    + ${save}

    - python_pyc_check() {
    - local impl missing=() outdated=()
    - for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
    - _python_export "${impl}" EPYTHON PYT