Imported Upstream version 60.5.2 upstream/60.5.2
authorJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:43 +0000 (17:02 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:43 +0000 (17:02 +0900)
.bumpversion.cfg
CHANGES.rst
_distutils_hack/__init__.py
setup.cfg

index 5d0f65ac12dadca8b6140e3c6d4d916fa261dffd..07bfe8ded3a716958fa995dabca1a930f760c967 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 60.5.1
+current_version = 60.5.2
 commit = True
 tag = True
 
index f07b27e42cf852513919e61aef59e5ba9312db8a..a512ee1da63bbf6007ea84ee274fee87c8f86c4d 100644 (file)
@@ -1,3 +1,12 @@
+v60.5.2
+-------
+
+
+Misc
+^^^^
+* #2993: In _distutils_hack, for get-pip, simulate existence of setuptools.
+
+
 v60.5.1
 -------
 
index ab462f95086167b63d9fe71e118d4dc7b5f8fcc7..0108d854828addaade604457a53adee63db9fa76 100644 (file)
@@ -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):
         """
index 9676b131d1d06067b93d12da973db1eece714ab5..e895a3dc4bb165b3ac622d277214b16b7ac99e73 100644 (file)
--- 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