From b091d0ce774d3f5d1953cfae05838d163e58ea64 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Wed, 6 Oct 2021 07:30:49 +1000 Subject: [PATCH] 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 --- setup.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index a0109666..1567f868 100755 --- a/setup.py +++ b/setup.py @@ -1,10 +1,6 @@ #!/usr/bin/env python from __future__ import print_function -from setuptools import setup -from setuptools import Distribution -from setuptools.command.sdist import sdist -from setuptools.extension import Extension import subprocess import platform import re @@ -13,6 +9,13 @@ import shutil import shlex +os.environ['SETUPTOOLS_USE_DISTUTILS'] = 'local' + +from setuptools import setup +from setuptools import Distribution +from setuptools.command.sdist import sdist +from setuptools.extension import Extension + SKIP_CYTHON_FILE = '__dont_use_cython__.txt'