Skip to content

Commit b091d0c

Browse files
committed
Use distutils provided by setuptools
The distutils module provided by the stdlib has been deprecated in Python 3.10. This PR sets an env var that is read by setuptools which will shim its vendored copy of distutils if present avoiding a failure once distutils is removed from the stdlib. Signed-off-by: Jordan Borean <jborean93@gmail.com>
1 parent 2bde020 commit b091d0c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

setup.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#!/usr/bin/env python
22
from __future__ import print_function
33

4-
from setuptools import setup
5-
from setuptools import Distribution
6-
from setuptools.command.sdist import sdist
7-
from setuptools.extension import Extension
84
import subprocess
95
import platform
106
import re
@@ -13,6 +9,13 @@
139
import shutil
1410
import shlex
1511

12+
os.environ['SETUPTOOLS_USE_DISTUTILS'] = 'local'
13+
14+
from setuptools import setup
15+
from setuptools import Distribution
16+
from setuptools.command.sdist import sdist
17+
from setuptools.extension import Extension
18+
1619

1720
SKIP_CYTHON_FILE = '__dont_use_cython__.txt'
1821

0 commit comments

Comments
 (0)