• [gentoo-dev] [PATCH] disttils-r1.eclass: Support GPEP517_TESTING mode

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Tue Apr 5 13:50:01 2022
    Support GPEP517_TESTING variable to enable using dev-python/gpep517
    instead of inline Python snippets. This is meant to provide
    the necessary testing before we stabilize it and switch over.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 88 ++++++++++++++++++++++++--------------
    1 file changed, 57 insertions(+), 31 deletions(-)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index ed2e9f70269f..06b614d9018a 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -151,6 +151,13 @@ esac
    # ${DISTUTILS_DEPS}"
    # @CODE

    +# @ECLASS_VARIABLE: GPEP517_TESTING
    +# @USER_VARIABLE
    +# @DESCRIPTION:
    +# Enable in make.conf to test building via dev-python/gpep517 instead of
    +# inline Python snippets. dev-python/gpep517 needs to be installed
    +# first.
    +
    if [[ ! ${_DISTUTILS_R1} ]]; then

    [[ ${EAPI} == 6 ]] && inherit eutils xdg-utils
    @@ -938,16 +945,20 @@ _distutils-r1_get_backend() {
    if [[ -f pyproject.toml ]]; then
    # if pyproject.toml exists, try getting the backend from it
    # NB: this could fail if pyproject.toml doesn't list one
    - build_backend=$(
    - "${EPYTHON}" - 3>&1 <<-EOF
    - import os
    - import tomli
    - print(tomli.load(op