Commit bedaf130 authored by Jason R. Coombs's avatar Jason R. Coombs

Allow opt-in and opt-out of distutils adoption at run time with...

Allow opt-in and opt-out of distutils adoption at run time with SETUPTOOLS_USE_DISTUTILS environment variable.
parent 67f0cc59
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.
......@@ -4,7 +4,7 @@ import os
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
......
......@@ -23,9 +23,10 @@ def clear_distutils():
def enabled():
"""
Provide an escape hatch for environments wishing to opt out.
Allow selection of distutils by environment variable.
"""
return 'SETUPTOOLS_DISTUTILS_ADOPTION_OPT_OUT' not in os.environ
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
return which == 'local'
def ensure_local_distutils():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment