From: JinWang An Date: Mon, 27 Mar 2023 08:02:43 +0000 (+0900) Subject: Imported Upstream version 60.5.2 X-Git-Tag: upstream/60.5.2^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d923efce719755773f06fa22cb90f873d57c8a5d;p=platform%2Fupstream%2Fpython-setuptools.git Imported Upstream version 60.5.2 --- diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5d0f65a..07bfe8d 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 60.5.1 +current_version = 60.5.2 commit = True tag = True diff --git a/CHANGES.rst b/CHANGES.rst index f07b27e..a512ee1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,12 @@ +v60.5.2 +------- + + +Misc +^^^^ +* #2993: In _distutils_hack, for get-pip, simulate existence of setuptools. + + v60.5.1 ------- diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py index ab462f9..0108d85 100644 --- a/_distutils_hack/__init__.py +++ b/_distutils_hack/__init__.py @@ -136,11 +136,36 @@ class DistutilsMetaFinder: """ if self.pip_imported_during_build(): return - if self.is_get_pip(): - return clear_distutils() self.spec_for_distutils = lambda: None + def spec_for_setuptools(self): + """ + get-pip imports setuptools solely for the purpose of + determining if it's installed. In this case, provide + a stubbed spec to represent setuptools being present + without invoking any behavior. + + Workaround for pypa/get-pip#137. + """ + if not self.is_get_pip(): + return + + import importlib + + class StubbedLoader(importlib.abc.Loader): + + def create_module(self, spec): + import types + return types.ModuleType('setuptools') + + def exec_module(self, module): + pass + + return importlib.util.spec_from_loader( + 'setuptools', StubbedLoader(), + ) + @classmethod def pip_imported_during_build(cls): """ diff --git a/setup.cfg b/setup.cfg index 9676b13..e895a3d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools -version = 60.5.1 +version = 60.5.2 author = Python Packaging Authority author_email = distutils-sig@python.org description = Easily download, build, install, upgrade, and uninstall Python packages