• [gentoo-dev] [PATCH 1/2 v2] distutils-r1.eclass: Support deprecated fli

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Jan 27 21:30:02 2022
    Detect, report and fix the deprecated flit/poetry backends to use
    flit_core and poetry_core respectively. In both cases, the end result
    is the same. Using flit involves unnecessary dependencies, and poetry
    is not even packaged right now (and has even worse dependency hell).

    Signed-off-by: Michał Górny <[email protected]>
    ---
    eclass/distutils-r1.eclass | 25 +++++++++++++++++++++++--
    1 file changed, 23 insertions(+), 2 deletions(-)

    Changes in v2: instead of failing and requiring patching ebuilds,
    just emit a QA warning and switch backend internally.

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index 7dfd92691b59..f7c6ea202ab0 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -862,13 +862,13 @@ _distutils-r1_backend_to_key() {

    local backend=${1}
    case ${backend} in
    - flit_core.buildapi)
    + flit_core.buildapi|flit.buildapi)
    echo flit
    ;;
    pdm.pep517.api)
    echo pdm
    ;;
    - poetry.core.masonry.api)
    + poetry.core.masonry.api|poetry.masonry.api)
    echo poetry
    ;;
    setuptools.build_meta|setuptools.build_meta:__legacy__)
    @@ -950,6 +950,27 @@ distutils-r1_python_compile() {
    eerror "(backend: ${build_backend})"
    die "DISTUTILS_USE_PEP517 value incorrect"
    fi
    +
    + # fix deprecated backends up
    + local new_backend
  • From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Thu Jan 27 21:30:02 2022
    Signed-off-by: Michał Górny <[email protected]>
    ---
    eclass/distutils-r1.eclass | 2 +-
    eclass/python-any-r1.eclass | 2 +-
    eclass/python-r1.eclass | 2 +-
    eclass/python-single-r1.eclass | 2 +-
    eclass/python-utils-r1.eclass | 2 +-
    5 files changed, 5 insertions(+), 5 deletions(-)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index f7c6ea202ab0..e25263ee7e1d 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -42,7 +42,7 @@
    # relevant to the packages using distutils-r1.
    #
    # For more information, please see the Python Guide:
    -# https://dev.gentoo.org/~mgorny/python-guide/
    +# https://projects.gentoo.org/python/guide/

    case "${EAPI:-0}" in
    [0-5])
    diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
    index 7af9474d9a1f..f7cc6e10e9be 100644
    --- a/eclass/python-any-r1.eclass
    +++ b/eclass/python-any-r1.eclass
    @@ -36,7 +36,7 @@
    # both.
    #
    # For more information, please see the Python Guide:
    -# https://dev.gentoo.org/~mgorny/python-guide/
    +# https:/