Skip to content

Commit 7e7d916

Browse files
committed
Import setup from setuptools
setuptools 60 uses its own bundled version of distutils, by default. It injects this into sys.modules, at import time. So we need to make sure that it is imported, before anything else imports distutils, to ensure everything is using the same distutils version. This change in setuptools is to prepare for Python 3.12, which will drop distutils. In this case, the best way to deal with the problem is to just use setuptools' setup(). Fixes: https://bugs.debian.org/1022482 and https://bugs.debian.org/1022538
1 parent c467d6f commit 7e7d916

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

packages/mbed-greentea/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424

2525
import os
2626
from io import open
27-
from distutils.core import setup
28-
from setuptools import find_packages
27+
from setuptools import find_packages, setup
2928

3029
DESCRIPTION = "mbed 3.0 onwards test suite, codename Greentea. The test suite is a collection of tools that enable automated testing on mbed-enabled platforms"
3130
OWNER_NAMES = 'Anna Bridge, Qinghao Shi'

packages/mbed-host-tests/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@
2323
"""
2424

2525
import os
26-
from distutils.core import setup
2726
from io import open
28-
from setuptools import find_packages
27+
from setuptools import find_packages, setup
2928

3029
DESCRIPTION = "mbed tools used to flash, reset and supervise test execution for mbed-enabled devices"
3130
OWNER_NAMES = 'Qinghao Shi'

packages/mbed-ls/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,8 @@
2020
"""
2121

2222
import os
23-
from distutils.core import setup
2423
from io import open
25-
from setuptools import find_packages
24+
from setuptools import find_packages, setup
2625

2726
DESCRIPTION = "mbed-ls is a Python module that detects and lists mbed-enabled devices connected to the host computer"
2827
OWNER_NAMES = 'Graham Hammond, Mark Edgeworth'

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
import os
1717
import sys
18-
from distutils.core import setup
19-
from setuptools import find_packages
18+
from setuptools import find_packages, setup
2019

2120
DESCRIPTION = "The tools to build, test, and work with Mbed OS"
2221
OWNER_NAMES = "Jimmy Brisson, Brian Daniels"

0 commit comments

Comments
 (0)