File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 4
4
import inspect
5
5
import platform
6
6
from collections .abc import Callable
7
- from typing import Any , ClassVar , cast
7
+ from typing import TYPE_CHECKING , Any , ClassVar , cast
8
8
9
9
import setuptools
10
10
15
15
import distutils .command .install as orig
16
16
from distutils .errors import DistutilsArgError
17
17
18
+ if TYPE_CHECKING :
19
+ # This is only used for a type-cast, don't import at runtime or it'll cause deprecation warnings
20
+ from .easy_install import easy_install as easy_install_cls
21
+ else :
22
+ easy_install_cls = None
23
+
18
24
# Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for
19
25
# now. See https://github.com/pypa/setuptools/issues/199/
20
26
_install = orig .install
@@ -131,7 +137,9 @@ def _called_from_setup(run_frame):
131
137
return False
132
138
133
139
def do_egg_install (self ) -> None :
134
- easy_install = self .distribution .get_command_class ('easy_install' )
140
+ easy_install = cast (
141
+ type [easy_install_cls ], self .distribution .get_command_class ('easy_install' )
142
+ )
135
143
136
144
cmd = easy_install (
137
145
self .distribution ,
You can’t perform that action at this time.
0 commit comments