• [gentoo-dev] [PATCH 0/5] distutils-r1 & python-utils-r1: cleanup old st

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Dec 8 20:00:02 2022
    Hi,

    Here's a short series of patches to clean some obsolete stuff:

    a. support for meson-python < 0.11.0 (that did not provide the ability
    to pass meson options)

    b. support for EAPI 6 in distutils-r1 (no longer used in ::gentoo)

    c. conditional support for python2_7 in python-any-r1 (likewise)

    d. unused code related to support for old Python versions

    While at it, I've also noticed that we're applying wrong (python3.8 era) python_optimize logic to PyPy3.9.

    --
    Best regards,
    Michał Górny


    Michał Górny (5):
    distutils-r1.eclass: Require meson-python >= 0.11.0
    distutils-r1.eclass: Remove EAPI 6 support
    python-any-r1.eclass: Stop allowing python2_7
    python-utils-r1.eclass: Clean up post disabling python2_7 compat
    python-utils-r1.eclass: Update python_optimize for PyPy3.9

    eclass/distutils-r1.eclass | 85 +++++++++++++----------------------
    eclass/python-any-r1.eclass | 1 -
    eclass/python-utils-r1.eclass | 68 +++++++++-------------------
    3 files changed, 51 insertions(+), 103 deletions(-)

    --
    2.38.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 Thu Dec 8 20:00:02 2022
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 65 ++++++++++-------------------------
    1 file changed, 19 insertions(+), 46 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index c0099fa756ad..84c37cd29d60 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -133,9 +133,9 @@ _python_set_impls() {
    # please keep them in sync with _PYTHON_ALL_IMPLS
    # and _PYTHON_HISTORICAL_IMPLS
    case ${i} in
    - pypy3|python2_7|python3_[89]|python3_1[01])
    + pypy3|python3_[89]|python3_1[01])
    ;;
    - jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-6]|python3_[1-7])
    + jython2_7|pypy|pypy1_[89]|pypy2_0|python2_[5-7]|python3_[1-7])
    obsolete+=( "${i}" )
    ;;
    *)
    @@ -172,13 +172,7 @@ _python_set_impls() {
    done

    if [[ ! ${supp[@]} ]]; then
    - # special-case python2_7 for python-any-r1
    - if [[ ${_PYTHON_ALLOW_PY27} ]] && has python2_7 "${PYTHON_COMPAT[@]}"
    - then
    - supp+=( python2_7 )
    - else
    - die "No sup
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Dec 8 20:00:02 2022
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 43 +++++++++++++++++---------------------
    1 file changed, 19 insertions(+), 24 deletions(-)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index 97c5e562bc0f..65004ba856f9 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -236,7 +236,7 @@ _distutils_set_globals() {
    ;;
    meson-python)
    bdep+='
    - >=dev-python/meson-python-0.10.0-r1[${PYTHON_USEDEP}]
    + >=dev-python/meson-python-0.11.0[${PYTHON_USEDEP}]
    '
    ;;
    pbr)
    @@ -1312,29 +1312,24 @@ distutils_pep517_install() {
    local config_settings=
    case ${DISTUTILS_USE_PEP517} in
    meson-python)
    - # TODO: remove the condition once we BDEP on >=0.11
    - if has_version -b ">=dev-python/meson-python-0.11"; then
    - local -x NINJAOPTS=$(get_NINJAOPTS)
    - config_settings=$(
    - "${EPYTHON}" - "${DISTUTILS_ARGS[@]}" <<-EOF || die
    - import json
    - import os
    - import shlex
    - import sys
    -
    - ninjaopts =
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Dec 8 20:00:02 2022
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/python-utils-r1.eclass | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 84c37cd29d60..df955371483e 100644
    --- a/eclass/python-utils-r1.eclass
    +++ b/eclass/python-utils-r1.eclass
    @@ -629,13 +629,14 @@ python_optimize() {

    einfo "Optimize Python modules for ${instpath}"
    case "${EPYTHON}" in
    - python3.8|pypy3)
    + python3.8)
    # both levels of optimization are separate since 3.5
    "${PYTHON}" -m compileall -j "${jobs}" -q -f -d "${instpath}" "${d}"
    "${PYTHON}" -O -m compileall -j "${jobs}" -q -f -d "${instpath}" "${d}"
    "${PYTHON}" -OO -m compileall -j "${jobs}" -q -f -d "${instpath}" "${d}"
    ;;
    - python*)
    + python*|pypy3)
    + # Python 3.9+
    "${PYTHON}" -m compileall -j "${jobs}" -o 0 -o 1 -o 2 --hardlink-dupes -q -f -d "${instpath}" "${d}"
    ;;
    pypy)
    --
    2.38.1

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