Skip to content

Commit f08c052

Browse files
authored
Merge pull request #2376 from pypa/feature/stdlib-distutils-default-again
Make stdlib distutils the default again. Stop the burning.
2 parents 8eb9efa + 9e7261b commit f08c052

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

_distutils_hack/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def enabled():
3737
"""
3838
Allow selection of distutils by environment variable.
3939
"""
40-
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
40+
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
4141
return which == 'local'
4242

4343

changelog.d/2350.change.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Setuptools reverts using the included distutils by default. Platform maintainers and system integrators and others are *strongly* encouraged to set ``SETUPTOOLS_USE_DISTUTILS=local`` to help identify and work through the reported issues with distutils adoption, mainly to file issues and pull requests with pypa/distutils such that distutils performs as needed across every supported environment.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class install_with_pth(install):
100100
_pth_contents = textwrap.dedent("""
101101
import os
102102
var = 'SETUPTOOLS_USE_DISTUTILS'
103-
enabled = os.environ.get(var, 'local') == 'local'
103+
enabled = os.environ.get(var, 'stdlib') == 'local'
104104
enabled and __import__('_distutils_hack').add_shim()
105105
""").lstrip().replace('\n', '; ')
106106

setuptools/tests/test_distutils_adoption.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ def test_distutils_local_with_setuptools(venv):
5656
"""
5757
Ensure local distutils is used when appropriate.
5858
"""
59-
loc = find_distutils(venv, imports='setuptools, distutils', env=dict())
59+
env = dict(SETUPTOOLS_USE_DISTUTILS='local')
60+
loc = find_distutils(venv, imports='setuptools, distutils', env=env)
6061
assert venv.name in loc.split(os.sep)
6162

6263

@@ -66,4 +67,5 @@ def test_distutils_local(venv):
6667
Even without importing, the setuptools-local copy of distutils is
6768
preferred.
6869
"""
69-
assert venv.name in find_distutils(venv, env=dict()).split(os.sep)
70+
env = dict(SETUPTOOLS_USE_DISTUTILS='local')
71+
assert venv.name in find_distutils(venv, env=env).split(os.sep)

0 commit comments

Comments
 (0)