Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete type annotations in "pip._internal.wheel_builder" #8337

Merged
merged 3 commits into from
Jun 27, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 if req.name),
deveshks marked this conversation as resolved.
Show resolved Hide resolved
)

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 if req.name]),
)
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 if req.name]),
)
# Return a list of requirements that failed to build
return build_successes, build_failures