Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 906991 - lib/portage/tests/runTests.py unconditionally imports deprecated/removed distutils
Summary: lib/portage/tests/runTests.py unconditionally imports deprecated/removed dist...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on: 908971
Blocks:
  Show dependency tree
 
Reported: 2023-05-23 12:05 UTC by Sam James
Modified: 2024-06-14 04:07 UTC (History)
0 users

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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-05-23 12:05:22 UTC
Python 3.12 removes distutils.

In setup.py, we import setuptools but fall back to distutils, which is fine.

But in lib/portage/tests/runTests.py, we unconditionally import it which falls flat w/ 3.12:
```
$ python3.12 /usr/lib/python3.10/site-packages/portage/tests/runTests.py
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/portage/tests/runTests.py", line 14, in <module>
    from distutils.dir_util import copy_tree
ModuleNotFoundError: No module named 'distutils'
```
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-06-14 04:00:13 UTC
ommit ad3994394af0bc975ec7c28bd60de496b580c25e
Author: James Le Cuirot <chewi@gentoo.org>
Date:   Sat Jul 15 12:20:27 2023 +0100

Migrate from setuptools to Meson and meson-python

This makes Portage PEP 517 compliant.

When building via meson-python, the man pages and logrotate config are
no longer included as there seems little point.

Bug: https://bugs.gentoo.org/910035
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>


commit f3b90592994c418286b10d883b4aee9a104f5e75
Author: James Le Cuirot <chewi@gentoo.org>
Date:   Fri Jul 21 21:36:31 2023 +0100

Drop custom test runner bits in favour of pytest

Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
Comment 2 Larry the Git Cow gentoo-dev 2024-06-14 04:07:57 UTC
The bug has been referenced in the following commit(s):

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

commit 85ba2adbcb631fc6a5399fd89cb4a03ffcc00236
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-06-14 04:03:54 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-06-14 04:04:54 +0000

    sys-apps/portage: depend on >=dev-build/meson-1.3.0-r1 in live
    
    No need for the || ( ... ) dance now and it lets us drop the setuptools
    dep as >=1.3.0 doesn't use distutils, but sysconfig.
    
    Noticed when looking at bug #906991 which I'd forgot about.
    
    Bug: https://bugs.gentoo.org/906991
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/portage-9999.ebuild | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)