diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2020-09-02 20:48:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 20:48:42 -0400 |
commit | f08c052a0330fe503ea0e867efeb625c7c7b115e (patch) | |
tree | 8cc544a40273c8f93409dc4d80a2e2992ce4dcde | |
parent | 8eb9efac24a5bd7f964f6f09d142576f1b4a9e07 (diff) | |
parent | 9e7261b46e42591218ef3e5b6630ab5e2ea13adc (diff) | |
download | python-setuptools-git-f08c052a0330fe503ea0e867efeb625c7c7b115e.tar.gz |
Merge pull request #2376 from pypa/feature/stdlib-distutils-default-again
Make stdlib distutils the default again. Stop the burning.
-rw-r--r-- | _distutils_hack/__init__.py | 2 | ||||
-rw-r--r-- | changelog.d/2350.change.rst | 1 | ||||
-rwxr-xr-x | setup.py | 2 | ||||
-rw-r--r-- | setuptools/tests/test_distutils_adoption.py | 6 |
4 files changed, 7 insertions, 4 deletions
diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py index 2bc6df7a..3325817b 100644 --- a/_distutils_hack/__init__.py +++ b/_distutils_hack/__init__.py @@ -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' diff --git a/changelog.d/2350.change.rst b/changelog.d/2350.change.rst new file mode 100644 index 00000000..c06930e6 --- /dev/null +++ b/changelog.d/2350.change.rst @@ -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. @@ -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', '; ') diff --git a/setuptools/tests/test_distutils_adoption.py b/setuptools/tests/test_distutils_adoption.py index 8edd3f9b..a53773df 100644 --- a/setuptools/tests/test_distutils_adoption.py +++ b/setuptools/tests/test_distutils_adoption.py @@ -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) @@ -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) |