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

Issue #2140: Build wheels during pip install #2618

Merged
merged 3 commits into from
Apr 13, 2015

Conversation

rbtcollins
Copy link

This branch is building up to tackle issue #2140 - build wheels during install and then install those wheels.

@rbtcollins
Copy link
Author

The topo sort thuings are from pull #2616

@sigmavirus24
Copy link
Member

This sounds exciting

@rbtcollins rbtcollins force-pushed the issue-2140 branch 4 times, most recently from 2e35a5c to 4c89e07 Compare March 31, 2015 02:39
@alex
Copy link
Member

alex commented Mar 31, 2015

Can all the ensure_dir changes by refactored out into their own PR?

@rbtcollins
Copy link
Author

They're a single commit. Can pull it out if desired.

@rbtcollins rbtcollins force-pushed the issue-2140 branch 4 times, most recently from 758b819 to 82aba41 Compare April 1, 2015 01:47
@rbtcollins
Copy link
Author

Its mainly tested via all the existing tests, but I added an explicit test looking at the output to be sure building was happening and handling of non-wheelable things.

@rbtcollins rbtcollins force-pushed the issue-2140 branch 11 times, most recently from c2c03a1 to affd2bf Compare April 2, 2015 07:47
@rbtcollins
Copy link
Author

I'm not sure why we're seeing those failures. Its not as simple as hashseed - I've tried using the same hashseed locally. It might be an isolation failure, or something. There's obviously an underlying issue, but until I can provoke it I can't fix it :(

I'm going to try adding diagnostic changes on top of the stack to do that.

@rbtcollins rbtcollins force-pushed the issue-2140 branch 2 times, most recently from c08a7f0 to e93b9ed Compare April 3, 2015 02:50
try:
os.makedirs(path)
except OSError as e:
if e.errno == errno.EEXIST:
Copy link
Member

Choose a reason for hiding this comment

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

or a shorter version:

if e.errno != errno.EEXIST:
    raise

@rbtcollins
Copy link
Author

This now has a limit on it to not build or cache wheels for unversioned things. E.g. unless the url looks like an archive, we won't cache for it at all, which means that e.g. git+https://github.com/pypa/pip will not get cached wheels built. But a url like https://github.com/pypa/project-2 will. This isn't perfect, but it should be enough to avoid the vast majority of potential breakage.

@rbtcollins rbtcollins force-pushed the issue-2140 branch 3 times, most recently from 869a222 to 4a25059 Compare April 13, 2015 02:24
@rbtcollins
Copy link
Author

  self.do_handshake()
File "/opt/python/3.2.5/lib/python3.2/ssl.py", line 451, in do_handshake
  self._sslobj.do_handshake()

ssl.SSLError: [Errno 8] _ssl.c:392: EOF occurred in violation of protocol

  • network failures.

This is needed for determining the wheel-cachability of a requirement.
This won't put wheels into that directory, but will read them if they
are there. --no-cache-dir will disable reading such wheels.
Building wheels before installing elminates a cause of broken environments -
where install fails after we've already installed one or more packages.

If a package fails to wheel, we run setup.py install as normally.
requirement_set,
finder,
build_options=[],
global_options=[],
Copy link
Member

Choose a reason for hiding this comment

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

Wondering if this is not an issue (for build_options and global_options)... maybe the use of these would disable the wheel caching as I dont think we want to build wheels for all possible options ?

@dstufft
Copy link
Member

dstufft commented Apr 13, 2015

I'm going to go ahead and merge this. Some things may need to be adjusted still but I don't think that we're going to fully hammer them out with this sitting in a branch, and having it sit in a branch just makes it harder on @rbtcollins to have to keep updating it. I do think that the overall structure is sound and that the general feature is something we want.

if not wheel.supported():
# Built for a different python/arch/etc
continue
candidates.append((wheel.support_index_min(), wheel_name))
Copy link
Contributor

Choose a reason for hiding this comment

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

I was specifically looking for this sorting by the support index. yay, it's here.

dstufft added a commit that referenced this pull request Apr 13, 2015
Issue #2140: Build wheels during pip install
@dstufft dstufft merged commit d043e4b into pypa:develop Apr 13, 2015
@qwcode
Copy link
Contributor

qwcode commented Apr 13, 2015

to be clear, I don't think we could release without the blacklist, so I assume that's coming.

@dstufft
Copy link
Member

dstufft commented Apr 13, 2015

Added #2675 to track that.

@xavfernandez
Copy link
Member

The *_options issue seems important also:

pip install foo --install-option some_option

will end up building the wheel and installing from it without the passed option...

@dstufft
Copy link
Member

dstufft commented Apr 13, 2015

So, that's actually already the case if you're installing from Wheels, they just get flat out ignored. We should probably figure something out to deal with them though.

@dstufft
Copy link
Member

dstufft commented Apr 13, 2015

Also added #2676 and #2677

@nils-werner
Copy link

Is there a way to make pip create wheels and store them in the cache dir without actually installing them? I would like to fill my wheel cache from time to time too...

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.