1
1
"""Orchestrator for building wheels from InstallRequirements.
2
2
"""
3
3
4
- # The following comment should be removed at some point in the future.
5
- # mypy: strict-optional=False
6
-
7
4
import logging
8
5
import os .path
9
6
import re
@@ -134,6 +131,7 @@ def _should_cache(
134
131
return True
135
132
return False
136
133
134
+ assert req .link
137
135
base , ext = req .link .splitext ()
138
136
if _contains_egg_info (base ):
139
137
return True
@@ -151,6 +149,7 @@ def _get_cache_dir(
151
149
wheel need to be stored.
152
150
"""
153
151
cache_available = bool (wheel_cache .cache_dir )
152
+ assert req .link
154
153
if cache_available and _should_cache (req ):
155
154
cache_dir = wheel_cache .get_path_for_link (req .link )
156
155
else :
@@ -198,7 +197,9 @@ def _build_one_inside_env(
198
197
):
199
198
# type: (...) -> Optional[str]
200
199
with TempDirectory (kind = "wheel" ) as temp_dir :
200
+ assert req .name
201
201
if req .use_pep517 :
202
+ assert req .metadata_directory
202
203
wheel_path = build_wheel_pep517 (
203
204
name = req .name ,
204
205
backend = req .pep517_backend ,
@@ -273,7 +274,7 @@ def build(
273
274
# Build the wheels.
274
275
logger .info (
275
276
'Building wheels for collected packages: %s' ,
276
- ', ' .join (req .name for req in requirements ),
277
+ ', ' .join (req .name for req in requirements ), # type: ignore
277
278
)
278
279
279
280
with indent_log ():
@@ -296,12 +297,12 @@ def build(
296
297
if build_successes :
297
298
logger .info (
298
299
'Successfully built %s' ,
299
- ' ' .join ([req .name for req in build_successes ]),
300
+ ' ' .join ([req .name for req in build_successes ]), # type: ignore
300
301
)
301
302
if build_failures :
302
303
logger .info (
303
304
'Failed to build %s' ,
304
- ' ' .join ([req .name for req in build_failures ]),
305
+ ' ' .join ([req .name for req in build_failures ]), # type: ignore
305
306
)
306
307
# Return a list of requirements that failed to build
307
308
return build_successes , build_failures
0 commit comments