From d9d8083936e5005df23c9a1d5b33e44560d98c06 Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Wed, 30 Dec 2020 07:08:46 +0900 Subject: [PATCH] Imported Upstream version 50.1.0 --- .bumpversion.cfg | 2 +- CHANGES.rst | 6 ++++++ _distutils_hack/__init__.py | 2 +- azure-pipelines.yml | 1 + setup.cfg | 2 +- setup.py | 2 +- setuptools/tests/test_distutils_adoption.py | 6 ++++-- 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index e85c79b..34b34fd 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 50.0.3 +current_version = 50.1.0 commit = True tag = True diff --git a/CHANGES.rst b/CHANGES.rst index 8f19261..a00d827 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,9 @@ +v50.1.0 +------- + +* #2350: 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. + + v50.0.3 ------- diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py index 2bc6df7..3325817 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/azure-pipelines.yml b/azure-pipelines.yml index ee77268..4567b9b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -76,6 +76,7 @@ stages: env: TWINE_PASSWORD: $(PyPI-token) TIDELIFT_TOKEN: $(Tidelift-token) + GITHUB_TOKEN: $(Github-token) displayName: 'publish to PyPI' condition: contains(variables['Build.SourceBranch'], 'tags') diff --git a/setup.cfg b/setup.cfg index 7236ae4..692eb1f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,7 @@ formats = zip [metadata] name = setuptools -version = 50.0.3 +version = 50.1.0 description = Easily download, build, install, upgrade, and uninstall Python packages author = Python Packaging Authority author_email = distutils-sig@python.org diff --git a/setup.py b/setup.py index 34654e1..2bd48da 100755 --- a/setup.py +++ b/setup.py @@ -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 8edd3f9..a53773d 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) -- 2.34.1