Skip to content

Commit 2245b42

Browse files
committed
Revert "Support next types-setuptools update (python#14781)"
This reverts commit ab7b69a.
1 parent ab7b69a commit 2245b42

File tree

2 files changed

+3
-19
lines changed

2 files changed

+3
-19
lines changed

mypyc/build.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import re
2626
import sys
2727
import time
28-
from typing import TYPE_CHECKING, Any, Dict, Iterable, NoReturn, Union, cast
28+
from typing import TYPE_CHECKING, Any, Dict, Iterable, NoReturn, cast
2929

3030
from mypy.build import BuildSource
3131
from mypy.errors import CompileError
@@ -41,13 +41,7 @@
4141
from mypyc.options import CompilerOptions
4242

4343
if TYPE_CHECKING:
44-
from distutils.core import Extension as _distutils_Extension
45-
from typing_extensions import TypeAlias
46-
47-
from setuptools import Extension as _setuptools_Extension
48-
49-
Extension: TypeAlias = Union[_setuptools_Extension, _distutils_Extension]
50-
44+
from distutils.core import Extension
5145

5246
try:
5347
# Import setuptools so that it monkey-patch overrides distutils

setup.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import os
77
import os.path
88
import sys
9-
from typing import TYPE_CHECKING, Any
109

1110
if sys.version_info < (3, 7, 0):
1211
sys.stderr.write("ERROR: You need Python 3.7 or later to use mypy.\n")
@@ -18,14 +17,11 @@
1817
# This requires setuptools when building; setuptools is not needed
1918
# when installing from a wheel file (though it is still needed for
2019
# alternative forms of installing, as suggested by README.md).
21-
from setuptools import Extension, find_packages, setup
20+
from setuptools import find_packages, setup
2221
from setuptools.command.build_py import build_py
2322

2423
from mypy.version import __version__ as version
2524

26-
if TYPE_CHECKING:
27-
from typing_extensions import TypeGuard
28-
2925
description = "Optional static typing for Python"
3026
long_description = """
3127
Mypy -- Optional Static Typing for Python
@@ -40,10 +36,6 @@
4036
""".lstrip()
4137

4238

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-
4739
def find_package_data(base, globs, root="mypy"):
4840
"""Find all interesting data files, for setup(package_data=)
4941
@@ -174,8 +166,6 @@ def run(self):
174166
# our Appveyor builds run out of memory sometimes.
175167
multi_file=sys.platform == "win32" or force_multifile,
176168
)
177-
assert is_list_of_setuptools_extension(ext_modules), "Expected mypycify to use setuptools"
178-
179169
else:
180170
ext_modules = []
181171

0 commit comments

Comments
 (0)