File: setuptools-60

package info (click to toggle)
python-mbed-host-tests 1.4.4-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 636 kB
  • sloc: python: 3,145; makefile: 30; sh: 14
file content (36 lines) | stat: -rw-r--r-- 1,221 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From: Stefano Rivera <stefanor@debian.org>
Date: Sat, 12 Nov 2022 21:42:04 +0200
Subject: 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().

Forwarded: https://github.com/ARMmbed/mbed-os-tools/pull/285
Bug-Debian: https://bugs.debian.org/1022482
---
 setup.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 49f967e..698a7d8 100644
--- a/setup.py
+++ b/setup.py
@@ -23,9 +23,8 @@ Author: Przemyslaw Wirkus <Przemyslaw.Wirkus@arm.com>
 """
 
 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 = 'Przemyslaw Wirkus, Azim Khan, Stefan Gutmann'