|
6 | 6 | import os
|
7 | 7 | import os.path
|
8 | 8 | import sys
|
9 |
| -from typing import TYPE_CHECKING, Any |
10 | 9 |
|
11 | 10 | if sys.version_info < (3, 7, 0):
|
12 | 11 | sys.stderr.write("ERROR: You need Python 3.7 or later to use mypy.\n")
|
|
18 | 17 | # This requires setuptools when building; setuptools is not needed
|
19 | 18 | # when installing from a wheel file (though it is still needed for
|
20 | 19 | # alternative forms of installing, as suggested by README.md).
|
21 |
| -from setuptools import Extension, find_packages, setup |
| 20 | +from setuptools import find_packages, setup |
22 | 21 | from setuptools.command.build_py import build_py
|
23 | 22 |
|
24 | 23 | from mypy.version import __version__ as version
|
25 | 24 |
|
26 |
| -if TYPE_CHECKING: |
27 |
| - from typing_extensions import TypeGuard |
28 |
| - |
29 | 25 | description = "Optional static typing for Python"
|
30 | 26 | long_description = """
|
31 | 27 | Mypy -- Optional Static Typing for Python
|
|
40 | 36 | """.lstrip()
|
41 | 37 |
|
42 | 38 |
|
43 |
| -def is_list_of_setuptools_extension(items: list[Any]) -> TypeGuard[list[Extension]]: |
44 |
| - return all(isinstance(item, Extension) for item in items) |
45 |
| - |
46 |
| - |
47 | 39 | def find_package_data(base, globs, root="mypy"):
|
48 | 40 | """Find all interesting data files, for setup(package_data=)
|
49 | 41 |
|
@@ -174,8 +166,6 @@ def run(self):
|
174 | 166 | # our Appveyor builds run out of memory sometimes.
|
175 | 167 | multi_file=sys.platform == "win32" or force_multifile,
|
176 | 168 | )
|
177 |
| - assert is_list_of_setuptools_extension(ext_modules), "Expected mypycify to use setuptools" |
178 |
| - |
179 | 169 | else:
|
180 | 170 | ext_modules = []
|
181 | 171 |
|
|
0 commit comments