Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 794166 - Python 3.10: distutils package is deprecated and slated for removal in Python 3.12
Summary: Python 3.10: distutils package is deprecated and slated for removal in Python...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
: 794139 (view as bug list)
Depends on:
Blocks: 785484
  Show dependency tree
 
Reported: 2021-06-04 14:07 UTC by penguinolog
Modified: 2021-07-05 01:41 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description penguinolog 2021-06-04 14:07:07 UTC
In case of Python 3.10 migration, warnings are produced during emerge usage:

/usr/lib/portage/python3.10/ebuild-ipc.py:46: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig

/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig

Reproducible: Always

Steps to Reproduce:
1. Install python 3.10 as main
2. emerge --sync
3. Try to update any package



For python site-packages location is suitable to use:
sysconfig.get_path('purelib')
instead of
distutils.sysconfig.get_python_lib()

sysconfig package is available since python 3.2
Comment 1 Ionen Wolkens gentoo-dev 2021-06-05 05:50:48 UTC
*** Bug 794139 has been marked as a duplicate of this bug. ***
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-06-05 09:51:45 UTC
Another reproducer is:

"""
$ portageq foo

/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
"""

These warnings are very widespread.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2021-06-05 10:01:05 UTC
For "ebuild" tool the session looks even worse:

"""
$ ebuild diffoscope-177.ebuild clean prepare
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.sysconfig
/usr/lib/python-exec/python3.10/portageq:29: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
  import distutils.sysconfig
 * diffoscope-177.tar.gz BLAKE2B SHA512 size ;-) ...  
"""
Comment 4 Zac Medico gentoo-dev 2021-06-05 19:03:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=916aba5a91733a2f39ea26e35879fc2f993e7ad1

commit 916aba5a91733a2f39ea26e35879fc2f993e7ad1
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2021-06-04 09:07:44 +0200
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-05 11:34:30 -0700

    Replace deprecated distutils.sysconfig uses
    
    Closes: https://github.com/gentoo/portage/pull/725
    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 bin/ebuild-ipc.py | 6 ++++--
 bin/portageq      | 6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)
Comment 5 Larry the Git Cow gentoo-dev 2021-06-05 21:07:38 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ad47c173baf4cad7c37f268fe0669efac994427

commit 4ad47c173baf4cad7c37f268fe0669efac994427
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-05 21:03:45 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-05 21:07:11 +0000

    sys-apps/portage: Add setuptools bdepend to 9999 ebuild (bug 794166)
    
    Bug: https://bugs.gentoo.org/794166
    Package-Manager: Portage-3.0.19, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/portage-9999.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 Larry the Git Cow gentoo-dev 2021-06-05 21:08:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=b18d15009ba91ce2603f298290fccbe94d519ced

commit b18d15009ba91ce2603f298290fccbe94d519ced
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-05 20:55:20 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-05 20:55:46 +0000

    repoman/setup.py: prefer setuptools over distutils (bug 794166)
    
    Bug: https://bugs.gentoo.org/794166
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 repoman/setup.py | 40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)

https://gitweb.gentoo.org/proj/portage.git/commit/?id=08d28ce963be6617f4aeed3a74c5e9e7cf977156

commit 08d28ce963be6617f4aeed3a74c5e9e7cf977156
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-05 20:37:00 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-05 20:55:00 +0000

    setup.py: prefer setuptools over distutils (bug 794166)
    
    Bug: https://bugs.gentoo.org/794166
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 setup.py | 41 ++++++++++++++++++++++++++++-------------
 1 file changed, 28 insertions(+), 13 deletions(-)
Comment 7 Larry the Git Cow gentoo-dev 2021-06-06 06:11:52 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=68f93f983a61db4db436547f071d9ad2a2245c82

commit 68f93f983a61db4db436547f071d9ad2a2245c82
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-06 06:10:45 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-06 06:11:26 +0000

    app-portage/repoman: Add setuptools bdepend to 9999 (bug 794166)
    
    Reported-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Bug: https://bugs.gentoo.org/794166
    Package-Manager: Portage-3.0.19, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 app-portage/repoman/repoman-9999.ebuild | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 8 Larry the Git Cow gentoo-dev 2021-06-13 22:08:58 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c0f239a182977dcd67e5592dfedc5f07d927ad53

commit c0f239a182977dcd67e5592dfedc5f07d927ad53
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2021-06-13 22:03:39 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2021-06-13 22:08:03 +0000

    sys-apps/portage: Bump to version 3.0.20 for final EAPI 8
    
     #777492: PORTAGE_NICENESS: Consider autogroup scheduling
     #794166: setup.py: prefer setuptools over distutils
    
    Bug: https://bugs.gentoo.org/785484
    Bug: https://bugs.gentoo.org/777492
    Bug: https://bugs.gentoo.org/794166
    Package-Manager: Portage-3.0.20, Repoman-3.0.3
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.20.ebuild | 266 +++++++++++++++++++++++++++++++++
 2 files changed, 267 insertions(+)