From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C9CC9158087 for ; Fri, 28 Jan 2022 23:01:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 960A82BC003; Fri, 28 Jan 2022 23:01:36 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 80CBA2BC003 for ; Fri, 28 Jan 2022 23:01:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A514C3431A9 for ; Fri, 28 Jan 2022 23:01:35 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5003A2B0 for ; Fri, 28 Jan 2022 23:01:33 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1643410883.7cbd714491bd8a138dad0cec791b8e8f104c29cc.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/distutils-r1.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 7cbd714491bd8a138dad0cec791b8e8f104c29cc X-VCS-Branch: master Date: Fri, 28 Jan 2022 23:01:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c975bf48-bb9a-4d61-8f3d-cdf0ad4a3cd7 X-Archives-Hash: 770b00d6179d10fdbbbc065ae7937684 commit: 7cbd714491bd8a138dad0cec791b8e8f104c29cc Author: Michał Górny gentoo org> AuthorDate: Thu Jan 27 10:09:49 2022 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Jan 28 23:01:23 2022 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7cbd7144 distutils-r1.eclass: Support deprecated flit/poetry backends 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 gentoo.org> eclass/distutils-r1.eclass | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) 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= + case ${build_backend} in + flit.buildapi) + new_backend=flit_core.buildapi + ;; + poetry.masonry.api) + new_backend=poetry.core.masonry.api + ;; + esac + + if [[ -n ${new_backend} ]]; then + if [[ ! ${_DISTUTILS_DEPRECATED_BACKEND_WARNED} ]]; then + eqawarn "${build_backend} backend is deprecated. Please see:" + eqawarn "https://projects.gentoo.org/python/guide/distutils.html#deprecated-pep-517-backends" + eqawarn "The eclass will be using ${new_backend} instead." + _DISTUTILS_DEPRECATED_BACKEND_WARNED=1 + fi + build_backend=${new_backend} + fi fi einfo " Building the wheel via ${build_backend}"