Skip to content

Commit

Permalink
Merge pull request #8337 from deveshks/mypy/pip/internal
Browse files Browse the repository at this point in the history
Complete type annotations in "pip._internal.wheel_builder"
  • Loading branch information
sbidoul authored Jun 27, 2020
2 parents 9a3c082 + 9a8bcf3 commit 69a811c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Empty file.
13 changes: 7 additions & 6 deletions src/pip/_internal/wheel_builder.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
"""Orchestrator for building wheels from InstallRequirements.
"""

# The following comment should be removed at some point in the future.
# mypy: strict-optional=False

import logging
import os.path
import re
Expand Down Expand Up @@ -134,6 +131,7 @@ def _should_cache(
return True
return False

assert req.link
base, ext = req.link.splitext()
if _contains_egg_info(base):
return True
Expand All @@ -151,6 +149,7 @@ def _get_cache_dir(
wheel need to be stored.
"""
cache_available = bool(wheel_cache.cache_dir)
assert req.link
if cache_available and _should_cache(req):
cache_dir = wheel_cache.get_path_for_link(req.link)
else:
Expand Down Expand Up @@ -198,7 +197,9 @@ def _build_one_inside_env(
):
# type: (...) -> Optional[str]
with TempDirectory(kind="wheel") as temp_dir:
assert req.name
if req.use_pep517:
assert req.metadata_directory
wheel_path = build_wheel_pep517(
name=req.name,
backend=req.pep517_backend,
Expand Down Expand Up @@ -273,7 +274,7 @@ def build(
# Build the wheels.
logger.info(
'Building wheels for collected packages: %s',
', '.join(req.name for req in requirements),
', '.join(req.name for req in requirements), # type: ignore
)

with indent_log():
Expand All @@ -296,12 +297,12 @@ def build(
if build_successes:
logger.info(
'Successfully built %s',
' '.join([req.name for req in build_successes]),
' '.join([req.name for req in build_successes]), # type: ignore
)
if build_failures:
logger.info(
'Failed to build %s',
' '.join([req.name for req in build_failures]),
' '.join([req.name for req in build_failures]), # type: ignore
)
# Return a list of requirements that failed to build
return build_successes, build_failures

0 comments on commit 69a811c

Please sign in to comment.