MCPcopy Index your code
hub / github.com/python/mypy / get_extension

Function get_extension

mypyc/build.py:151–166  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

149
150
151def get_extension() -> type[Extension]:
152 # We can work with either setuptools or distutils, and pick setuptools
153 # if it has been imported.
154 use_setuptools = "setuptools" in sys.modules
155 extension_class: type[Extension]
156
157 if sys.version_info < (3, 12) and not use_setuptools:
158 import distutils.core
159
160 extension_class = distutils.core.Extension
161 else:
162 if not use_setuptools:
163 sys.exit("error: setuptools not installed")
164 extension_class = setuptools.Extension
165
166 return extension_class
167
168
169def setup_mypycify_vars() -> None:

Callers 3

build_using_shared_libFunction · 0.85
build_single_moduleFunction · 0.85
mypycifyFunction · 0.85

Calls 1

exitMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…