[bumpversion]
-current_version = 49.1.1
+current_version = 49.1.2
commit = True
tag = True
+v49.1.2
+-------
+
+* #2232: In preparation for re-enabling a local copy of distutils, Setuptools now honors an environment variable, SETUPTOOLS_USE_DISTUTILS. If set to 'stdlib' (current default), distutils will be used from the standard library. If set to 'local' (default in a imminent backward-incompatible release), the local copy of distutils will be used.
+
+
v49.1.1
-------
[metadata]
name = setuptools
-version = 49.1.1
+version = 49.1.2
description = Easily download, build, install, upgrade, and uninstall Python packages
author = Python Packaging Authority
author_email = distutils-sig@python.org
import functools
# Disabled for now due to: #2228, #2230
-# import setuptools.distutils_patch # noqa: F401
+import setuptools.distutils_patch # noqa: F401
import distutils.core
import distutils.filelist
import sys
import re
+import os
import importlib
import warnings
del sys.modules[name]
+def enabled():
+ """
+ Allow selection of distutils by environment variable.
+ """
+ which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
+ return which == 'local'
+
+
def ensure_local_distutils():
clear_distutils()
distutils = importlib.import_module('setuptools._distutils')
assert '_distutils' in core.__file__, core.__file__
-ensure_local_distutils()
+if enabled():
+ ensure_local_distutils()