summaryrefslogtreecommitdiff
path: root/_distutils_hack/__init__.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2022-02-11 11:56:22 -0500
committerJason R. Coombs <jaraco@jaraco.com>2022-02-11 11:56:22 -0500
commit76bfec83a18a2913529151be9220e5452dda2475 (patch)
treec42f77961c6d98bd744112116d5ad9973471d926 /_distutils_hack/__init__.py
parentf38d13906be5f3cfe3dadc0333c5ef01badaf777 (diff)
downloadpython-setuptools-git-76bfec83a18a2913529151be9220e5452dda2475.tar.gz
Remove workaround for pypa/get-pip#137.
Diffstat (limited to '_distutils_hack/__init__.py')
-rw-r--r--_distutils_hack/__init__.py35
1 files changed, 0 insertions, 35 deletions
diff --git a/_distutils_hack/__init__.py b/_distutils_hack/__init__.py
index 1f8daf49..c6f7de60 100644
--- a/_distutils_hack/__init__.py
+++ b/_distutils_hack/__init__.py
@@ -139,33 +139,6 @@ class DistutilsMetaFinder:
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. Ref #2993.
- """
- if not self.is_script('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):
"""
@@ -178,14 +151,6 @@ class DistutilsMetaFinder:
)
@staticmethod
- def is_script(name):
- try:
- import __main__
- return os.path.basename(__main__.__file__) == f'{name}.py'
- except AttributeError:
- pass
-
- @staticmethod
def frame_file_is_setup(frame):
"""
Return True if the indicated frame suggests a setup.py file.