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

Fix build directory assertion for a PEP 517/518 world #6171

merged 3 commits into from Jan 23, 2019


None yet
6 participants
Copy link

pradyunsg commented Jan 23, 2019

Closes #6158

pradyunsg added some commits Jan 23, 2019

Check wheel build locations only when ephem cache isn't used
When the ephemeral cache is used, the build can always occur. There is
no need to check for those.
@@ -840,12 +840,6 @@ def build(
newly built wheel, in preparation for installation.
:return: True if all the wheels built correctly.

This comment has been minimized.


xavfernandez Jan 23, 2019


(unrelated to this PR but the docstring seems obsolete :) )

have_directory_for_build = self._wheel_dir or (
autobuilding and self.wheel_cache.cache_dir
assert have_directory_for_build

This comment has been minimized.


cjerdonek Jan 23, 2019


For future reference, it looks like an alternative way to do this would be to calculate a needs_ephem_cache variable (or similarly defined variable) prior to the for loop above. And then check that ephem_cache is true inside the for loop prior to appending to the buildset (depending on whether needs_ephem_cache is true). That would give you more information if the condition ever fails, and let you raise an exception with more specific, contextual info (as well as fail faster).

This comment has been minimized.


pradyunsg Jan 23, 2019

Author Member

Yea, this worked and I decided "good is better than perfect" wrt code cleanup here. :)

@pradyunsg pradyunsg merged commit ab79665 into pypa:master Jan 23, 2019

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
news-file/pr News files updated and/or change is trivial.

@pradyunsg pradyunsg deleted the pradyunsg:fix/pep-517-building-assertion branch Jan 23, 2019


This comment was marked as spam.

Copy link

vmarkovtsev commented on 7db2666 Jan 23, 2019

I wonder how pip is tested if such a devastating thing was missed before releasing. It broke all our Travis builds.

This comment has been minimized.

Copy link

ringerc replied Jan 24, 2019

This should fix build failures like

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

This comment has been minimized.

Copy link
Member Author

pradyunsg replied Jan 24, 2019

See #6158.

siming85 added a commit to CiscoTestAutomation/pyats-docker that referenced this pull request Jan 24, 2019


This comment has been minimized.

Copy link

siming85 commented Jan 24, 2019

still seeing this issue in v19.0.1 in alpine:3.8 when pip installing using --no-cache-dir.

adding --no-use-pep517 seems to be a workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment