• [gentoo-dev] [PATCH 1/5] python-utils-r1.eclass: Minimize pytest tempdi

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Jan 4 18:10:01 2024
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 5 +++++
    1 file changed, 5 insertions(+)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index abb55bd2e942..27fb92a75aca 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1344,6 +1344,11 @@ epytest() {
    # count is more precise when we're dealing with a large number
    # of tests
    -o console_output_style=count
    + # minimize the temporary directory retention, the test suites
    + # of some packages can grow them pretty large and normally
    + # we don't need to preserve them
    + -o tmp_path_retention_count=0
    + -o tmp_path_retention_policy=failed
    )

    if [[ ! ${PYTEST_DISABLE_PLUGIN_AUTOLOAD} ]]; then
    --
    2.43.0

    --- 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 Thu Jan 4 18:20:01 2024
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 3 +++
    eclass/python-utils-r1.eclass | 22 ++++++++++++++++++++++
    2 files changed, 25 insertions(+)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index 4e77237c3009..014669c8c47c 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -618,6 +618,9 @@ distutils_enable_tests() {
    ;;
    pytest)
    test_pkgs='>=dev-python/pytest-7.3.1[${PYTHON_USEDEP}]' + if [[ -n ${EPYTEST_TIMEOUT} ]]; then
    + test_pkgs+=' dev-python/pytest-timeout[${PYTHON_USEDEP}]'
    + fi
    if [[ ${EPYTEST_XDIST} ]]; then
    test_pkgs+=' dev-python/pytest-xdist[${PYTHON_USEDEP}]'
    fi
    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 27fb92a75aca..22ab778b7e11 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -1296,6 +1296,16 @@ _python_check_occluded_packages() {
    # parameter, when calling epytest. The listed files will be entirely
    # skipped from test collect
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Jan 4 18:20:01 2024
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    dev-python/tox/tox-4.11.4.ebuild | 6 +-----
    1 file changed, 1 insertion(+), 5 deletions(-)

    diff --git a/dev-python/tox/tox-4.11.4.ebuild b/dev-python/tox/tox-4.11.4.ebuild
    index de87ecfd1e77..6715cafa12ae 100644
    --- a/dev-python/tox/tox-4.11.4.ebuild
    +++ b/dev-python/tox/tox-4.11.4.ebuild
    @@ -1,4 +1,4 @@
    -# Copyright 1999-2023 Gentoo Authors
    +# Copyright 1999-2024 Gentoo Authors
    # Distributed under the terms of the GNU General Public License v2

    EAPI=8
    @@ -83,8 +83,4 @@ python_test() {
    )

    epytest
    -
    - # tox leaves a *humonogous* tempdir which easily leads to ENOSPC
    - # when running in parallel with other packages
    - rm -r "${T}"/pytest* || die
    }
    --
    2.43.0

    --- 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 Thu Jan 4 18:20:01 2024
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 21 ++++++++++++++++++++-
    1 file changed, 20 insertions(+), 1 deletion(-)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index 014669c8c47c..e0a91001ef1f 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -2089,14 +2089,33 @@ _distutils-r1_post_python_install() {

    local sitedir=${D%/}$(python_get_sitedir)
    if [[ -d ${sitedir} ]]; then
    + local p
    _distutils-r1_strip_namespace_packages "${sitedir}"

    + local bad_versions=()
    + mapfile -d $'\0' -t bad_versions < <(
    + find "${sitedir}" -maxdepth 1 '(' \
    + -name '*-0.0.0.dist-info' -o \
    + -name '*-UNKNOWN.dist-info' -o \
    + -name '*-0.0.0.egg-info' -o \
    + -name '*-UNKNOWN.egg-info' \
    + ')' -print0
    + )
    +
    + if [[ -n ${bad_versions[@]} ]]; then
    + eqawarn "The following Python packages were installed with invalid/suspicious"
    + eqawarn "versions in the site-packages directory:"
    + eqawarn
    + for p in "${bad_versions[@]}"; do
    +
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Jan 4 18:20:01 2024
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    dev-python/trimesh/trimesh-4.0.8.ebuild | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/dev-python/trimesh/trimesh-4.0.8.ebuild b/dev-python/trimesh/trimesh-4.0.8.ebuild
    index 4a40c4a6730c..f666016b6084 100644
    --- a/dev-python/trimesh/trimesh-4.0.8.ebuild
    +++ b/dev-python/trimesh/trimesh-4.0.8.ebuild
    @@ -46,16 +46,16 @@ RDEPEND="
    BDEPEND="
    test? (
    dev-python/mapbox_earcut[${PYTHON_USEDEP}]
    - dev-python/pytest-timeout[${PYTHON_USEDEP}]
    )
    "

    +EPYTEST_TIMEOUT=900
    EPYTEST_XDIST=1
    distutils_enable_tests pytest

    python_test() {
    local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
    - epytest -p timeout --timeout=900
    + epytest
    }

    pkg_postinst() {
    --
    2.43.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)