commit:     41f25bec0bbf5d9bc3444f10a7da291c50b07a1b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 11 07:46:15 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Apr 11 19:58:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41f25bec

distutils-r1.eclass: Print deprecation warning for distutils builds

Print deprecation warnings for non-PEP517 builds using plain distutils.
This is a small subset of Python packages overall, and the first step
towards deprecating legacy build support.  Transitioning pure distutils
packages is also important to avoid .egg-info collisions when we switch
from CPython distutils to setuptools-vendored distutils.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/distutils-r1.eclass | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index ccdf0e025758..a7d5890a6b1b 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -867,6 +867,15 @@ distutils-r1_python_prepare_all() {
        if [[ ! ${DISTUTILS_USE_PEP517} ]]; then
                _distutils-r1_disable_ez_setup
                _distutils-r1_handle_pyproject_toml
+
+               case ${DISTUTILS_USE_SETUPTOOLS} in
+                       no)
+                               eqawarn "Non-PEP517 builds are deprecated for 
ebuilds using plain distutils."
+                               eqawarn "Please migrate to 
DISTUTILS_USE_PEP517=setuptools."
+                               eqawarn "Please see Python Guide for more 
details:"
+                               eqawarn "  
https://projects.gentoo.org/python/guide/distutils.html";
+                               ;;
+               esac
        fi
 
        if [[ ${DISTUTILS_IN_SOURCE_BUILD} && ! ${DISTUTILS_SINGLE_IMPL} ]]

Reply via email to