Skip to content

Commit

Permalink
Import setup from setuptools
Browse files Browse the repository at this point in the history
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
  • Loading branch information
stefanor committed Nov 13, 2022
1 parent c467d6f commit 7e7d916
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions packages/mbed-greentea/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

import os
from io import open
from distutils.core import setup
from setuptools import find_packages
from setuptools import find_packages, setup

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"
OWNER_NAMES = 'Anna Bridge, Qinghao Shi'
Expand Down
3 changes: 1 addition & 2 deletions packages/mbed-host-tests/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
"""

import os
from distutils.core import setup
from io import open
from setuptools import find_packages
from setuptools import find_packages, setup

DESCRIPTION = "mbed tools used to flash, reset and supervise test execution for mbed-enabled devices"
OWNER_NAMES = 'Qinghao Shi'
Expand Down
3 changes: 1 addition & 2 deletions packages/mbed-ls/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@
"""

import os
from distutils.core import setup
from io import open
from setuptools import find_packages
from setuptools import find_packages, setup

DESCRIPTION = "mbed-ls is a Python module that detects and lists mbed-enabled devices connected to the host computer"
OWNER_NAMES = 'Graham Hammond, Mark Edgeworth'
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@

import os
import sys
from distutils.core import setup
from setuptools import find_packages
from setuptools import find_packages, setup

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

0 comments on commit 7e7d916

Please sign in to comment.