• [gentoo-dev] [PATCH 0/7] distutils-r1.eclass: wheel reuse optimization,

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed May 15 21:00:01 2024
    Hello,

    Here's a small batch of patches that:

    1. Add support for reusing prior wheels if they are compatible to avoid invoking the (slow) build system multiple times when building for
    multiple targes. This is currently opt-in (via make.conf variable)
    and can benefit us in two cases:

    a. in pure Python packages to avoid repeatedly building wheel with
    the same files, and

    b. in packages using the stable API to avoid building identical
    extensions separately for every impl.

    2. Add support for EPYTEST_FLAGS variable that can be used by the user
    to quickly append additional flags to pytest invocation (e.g. `-x` to
    make them stop on first failure, or `-s` to disable output capture).

    3. Support passing ninja options to scikit-build-core, and update
    invocation for bugfixes from 0.9.4.



    Michał Górny (7):
    distutils-r1.eclass: Set DISTUTILS_WHEEL_PATH in PEP517 install
    distutils-r1.eclass: Store created wheels in DISTUTILS_WHEELS
    distutils-r1.eclass: Add a QA warning for pure Python file mismatch
    distutils-r1.eclass: Support reusing prior wheels when compatible
    python-utils-r1.eclass: Support passing EPYTEST_FLAGS
    distutils-r1.eclass: Update scikit-build-core to 0.9.4
    distutils-r1.eclass: Pass ninja options to scikit-build-core

    eclass/distutils-r1.eclass | 106 ++++++++++++++++++++++++++++++++--
    eclass/python-utils-r1.eclass | 11 +++-
    2 files changed, 110 insertions(+), 7 deletions(-)

    --
    2.45.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 Wed May 15 21:00:01 2024
    Closes: https://bugs.gentoo.org/905863
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 11 ++++++++++-
    1 file changed, 10 insertions(+), 1 deletion(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 275ac3a96523..584ed831f816 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1321,6 +1321,15 @@ _python_check_occluded_packages() {
    # Specifies the number of jobs for parallel (pytest-xdist) test runs.
    # When unset, defaults to -j from MAKEOPTS, or the current nproc.

    +# @ECLASS_VARIABLE: EPYTEST_FLAGS
    +# @USER_VARIABLE
    +# @DEFAULT_UNSET
    +# @DESCRIPTION:
    +# Additional flags to pass to pytest. This is intended to be set
    +# in the environment when debugging packages (options such as -x or -s
    +# are useful here), rather than globally. It must not be set
    +# in ebuilds.
    +
    # @FUNCTION: epytest
    # @USAGE: [<args>...]
    # @DESCRIPTION:
    @@ -1432,7 +1441,7 @@ epytest() {
    for x in "${EPYTEST_IGNORE[@]}"; do
    args+=( --ignore "${x}" )
    done
    - set -- "${EPYTHON}" -m pytest
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Wed May 15 21:00:01 2024
    Store the created wheel path in DISTUTILS_WHEEL_PATH when returning
    from distutils_pep517_install.

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

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index a67122a59a33..1037c0abe239 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -1343,6 +1343,10 @@ distutils_wheel_install() {
    \) -delete || die
    }

    +# @VARIABLE: DISTUTILS_WHEEL_PATH
    +# @DESCRIPTION:
    +# Path to the wheel created by distutils_pep517_install.
    +
    # @FUNCTION: distutils_pep517_install
    # @USAGE: <root>
    # @DESCRIPTION:
    @@ -1350,7 +1354,8 @@ distutils_wheel_install() {
    # backend and install it into <root>.
    #
    # This function is intended for expert use only. It does not handle
    -# wrapping executables.
    +# wrapping executables. The wheel path is returned
    +# in DISTUTILS_WHEEL_PATH variable.
    distutils_pep517_install() {
    debug-print-function ${FUNCNAME} "${@}"
    [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: root" @@ -1523,6 +1528,8 @@ distutils_pep517_in