Skip to content

Commit 69a811c

Browse files
authored
Merge pull request #8337 from deveshks/mypy/pip/internal
Complete type annotations in "pip._internal.wheel_builder"
2 parents 9a3c082 + 9a8bcf3 commit 69a811c

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

news/0EF5EAF5-F3CC-4B27-A128-872E6A4DC6B4.trivial

Whitespace-only changes.

src/pip/_internal/wheel_builder.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
"""Orchestrator for building wheels from InstallRequirements.
22
"""
33

4-
# The following comment should be removed at some point in the future.
5-
# mypy: strict-optional=False
6-
74
import logging
85
import os.path
96
import re
@@ -134,6 +131,7 @@ def _should_cache(
134131
return True
135132
return False
136133

134+
assert req.link
137135
base, ext = req.link.splitext()
138136
if _contains_egg_info(base):
139137
return True
@@ -151,6 +149,7 @@ def _get_cache_dir(
151149
wheel need to be stored.
152150
"""
153151
cache_available = bool(wheel_cache.cache_dir)
152+
assert req.link
154153
if cache_available and _should_cache(req):
155154
cache_dir = wheel_cache.get_path_for_link(req.link)
156155
else:
@@ -198,7 +197,9 @@ def _build_one_inside_env(
198197
):
199198
# type: (...) -> Optional[str]
200199
with TempDirectory(kind="wheel") as temp_dir:
200+
assert req.name
201201
if req.use_pep517:
202+
assert req.metadata_directory
202203
wheel_path = build_wheel_pep517(
203204
name=req.name,
204205
backend=req.pep517_backend,
@@ -273,7 +274,7 @@ def build(
273274
# Build the wheels.
274275
logger.info(
275276
'Building wheels for collected packages: %s',
276-
', '.join(req.name for req in requirements),
277+
', '.join(req.name for req in requirements), # type: ignore
277278
)
278279

279280
with indent_log():
@@ -296,12 +297,12 @@ def build(
296297
if build_successes:
297298
logger.info(
298299
'Successfully built %s',
299-
' '.join([req.name for req in build_successes]),
300+
' '.join([req.name for req in build_successes]), # type: ignore
300301
)
301302
if build_failures:
302303
logger.info(
303304
'Failed to build %s',
304-
' '.join([req.name for req in build_failures]),
305+
' '.join([req.name for req in build_failures]), # type: ignore
305306
)
306307
# Return a list of requirements that failed to build
307308
return build_successes, build_failures

0 commit comments

Comments
 (0)