Skip to content

Commit

Permalink
Check wheel build locations only when ephem cache isn't used
Browse files Browse the repository at this point in the history
When the ephemeral cache is used, the build can always occur. There is
no need to check for those.
  • Loading branch information
pradyunsg committed Jan 23, 2019
1 parent e55fcea commit 7db2666
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/pip/_internal/wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -840,12 +840,6 @@ def build(
newly built wheel, in preparation for installation.
:return: True if all the wheels built correctly.
"""
# TODO: This check fails if --no-cache-dir is set. And yet we
# might be able to build into the ephemeral cache, surely?
building_is_possible = self._wheel_dir or (
autobuilding and self.wheel_cache.cache_dir
)
assert building_is_possible

buildset = []
format_control = self.finder.format_control
Expand Down Expand Up @@ -884,6 +878,13 @@ def build(
if not buildset:
return []

# Is any wheel build not using the ephemeral cache?
if any(not ephem_cache for _, ephem_cache in buildset):
have_directory_for_build = self._wheel_dir or (
autobuilding and self.wheel_cache.cache_dir
)
assert have_directory_for_build

# TODO by @pradyunsg
# Should break up this method into 2 separate methods.

Expand Down

3 comments on commit 7db2666

@vmarkovtsev

This comment was marked as spam.

@ringerc
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fix build failures like

Traceback (most recent call last):
  File "virtualenv/local/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 176, in main
    status = self.run(options, args)
  File "virtualenv/local/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 346, in run
    session=session, autobuilding=True
  File "virtualenv/local/lib/python2.7/site-packages/pip/_internal/wheel.py", line 848, in build
    assert building_is_possible
AssertionError

@pradyunsg
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #6158.

Please sign in to comment.