Skip to content

Commit

Permalink
Merge pull request #2376 from pypa/feature/stdlib-distutils-default-a…
Browse files Browse the repository at this point in the history
…gain

Make stdlib distutils the default again. Stop the burning.
  • Loading branch information
jaraco authored Sep 3, 2020
2 parents 8eb9efa + 9e7261b commit f08c052
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _distutils_hack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def enabled():
"""
Allow selection of distutils by environment variable.
"""
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'local')
which = os.environ.get('SETUPTOOLS_USE_DISTUTILS', 'stdlib')
return which == 'local'


Expand Down
1 change: 1 addition & 0 deletions changelog.d/2350.change.rst
Original file line number Diff line number Diff line change
@@ -0,0 +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.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class install_with_pth(install):
_pth_contents = textwrap.dedent("""
import os
var = 'SETUPTOOLS_USE_DISTUTILS'
enabled = os.environ.get(var, 'local') == 'local'
enabled = os.environ.get(var, 'stdlib') == 'local'
enabled and __import__('_distutils_hack').add_shim()
""").lstrip().replace('\n', '; ')

Expand Down
6 changes: 4 additions & 2 deletions setuptools/tests/test_distutils_adoption.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def test_distutils_local_with_setuptools(venv):
"""
Ensure local distutils is used when appropriate.
"""
loc = find_distutils(venv, imports='setuptools, distutils', env=dict())
env = dict(SETUPTOOLS_USE_DISTUTILS='local')
loc = find_distutils(venv, imports='setuptools, distutils', env=env)
assert venv.name in loc.split(os.sep)


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

0 comments on commit f08c052

Please sign in to comment.