-
Notifications
You must be signed in to change notification settings - Fork 99
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
Support creating pyz files for different platforms #7
Support creating pyz files for different platforms #7
Conversation
Pull Request Test Coverage Report for Build 86
💛 - Coveralls |
Hi @dan-blanchard ! Thanks for the PR, this looks pretty promising... Some thoughts:
This actually feels a little faster than the old
Hiss is a python repl based on ipython... It fails to bootstrap due to being unable to import some part of iPython. Also, what about packages that don't publish wheels? We'll need some code to either build a wheel or fallback to I've noticed while working on
I've kind of gone back and forth on how best to handle this, should we just use
Yeah we can just remove all the shared object map stuff :) |
aha, so I figured out why
|
Ah, I was just testing the all-binary packages model. I’ll add a step that
builds the tarballs into wheels.
…On Fri, Apr 27, 2018 at 8:53 PM Loren Carvalho ***@***.***> wrote:
aha, so I figured out why hiss wasn't working, seems that if there is no
wheel then pip download grabs the tarball (duh), so we just need to sort
out what to do with those types of packages.
Collecting backcall
Using cached https://files.pythonhosted.org/packages/84/71/c8ca4f5bb1e08401b916c68003acf0a0655df935d74d93bf3f3364b310e0/backcall-0.1.0.tar.gz
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA7l2cHVHMVjGl-njvyfQDl4juteVMaPks5ts72NgaJpZM4TrAly>
.
|
Perhaps instead of replacing our use of Then, to build a multi-platform pyz, you'd simply need to download the wheels using Sure, it's an extra step, which can complicate build scripts (but only slightly), but it allows us to retain the important behavior of packaging a single site-packages directory (vital for pkg_resources performance) while also preserving the original API. I am still concerned about -- Loren |
Yeah, pip wheel was what I was thinking we could use to create the wheels
when we’ve got source packages and you’re not specifying all-binary.
…On Mon, Apr 30, 2018 at 12:38 AM Loren Carvalho ***@***.***> wrote:
@dan-blanchard <https://github.com/dan-blanchard>
Perhaps instead of replacing our use of pip install we should consider
the pip wheel command.. It offers the same Index options as install (such
as --find-links, --no-index, etc) which are vital to our internal use,
while also fetching wheels and building them when they are not already
available.
Then, to build a multi-platform pyz, you'd simply need to *download* the
wheels using pip itself, via the download args you gave as an example ( --python-version
36 --platform manylinux1_x86_64 --abi cp36m --implementation cp
--only-binary=:all: Cython numpy ), and a 2nd step (building the pyz via
shiv) using -f /path/to/wheelhouse --no-index
Sure, it's an extra step, which can complicate build scripts (but only
slightly), but it allows us to retain the important behavior of packaging a
single site-packages directory (vital for pkg_resources performance) while
also preserving the original API.
I am still concerned about .pth files being missing from packages that
are installed via wheel. Haven't had a chance to dig into that or
investigate how nspkg.pth files are handled.
-- Loren
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA7l2fqmiFoyQBZF-4rZnmsWENGYvhw6ks5ttpVCgaJpZM4TrAly>
.
|
So, I think I found a "workaround" that would allow you to accomplish what you want (manylinux compatible Step 1: download the desired wheels from pypi
Step 2: rename them such that they pass
Step 3: create a pyz with shiv
It won't work on Darwin, obviously (due to using manylinux wheels) but they DO seem to work as expected on Linux!
This method didn't require any changes to current shiv except fixing that map_shared_import bug you pointed out! This leads me to believe that the way we ought to solve this permanently is by requesting/proposing/submitting a change to |
I followed the twisty trail to the PyPA GH issue and followed up there, re skipping the PEP 425 checks. |
i'm probably stating the obvious, but I believe you can't cross-compile a sdist into a wheel. You'd have to build your pyz on the same platform which you are targeting. But in this case, |
I think it's theoretically possible to do some cross-compiling, but I'm not sure it's worth it, and even so it wouldn't be shiv's responsibility. |
91f96c6
to
398b84f
Compare
@sixninetynine I was out of town last week, so I missed a lot of the conversation here, and I'm not sure I'm fully caught up.
Adding a
That's what PEX's maintainers were recommending people do as a workaround instead of adding proper manylinux support, so... I'd rather not go that route. |
Hiya @dan-blanchard Yeah the conversation has definitely sprawled a bit 😄, we had some discussion on the pip tracker regarding overriding the pep425 checks as well, which imo would be the ideal way to solve it (as we could happily continue to rely on So let's define some scope to the desired outcome of this PR, If your origin (build) machine is linux then creating manylinux compatible pyz's happens automatically just by passing
Given that, what remaining gaps are we looking to fill? If we want to create manylinux pyz's from, say, OSX... that could be problematic given the current lay of the land. It would almost certainly mean we'd have to stop relying on The reason I'm somewhat resistant to that idea is that it would impose some reworking of our internal build plugins. We use https://github.com/linkedin/pygradle/ which pre-fetches all our requirements/deps based on gradle's dependency graph, so we already have a wheelhouse at shiv-creation time and can simply run shiv with |
|
you'd need to have Docker and pull the PyPA manylinux images and do the building inside it. You're basically running Linux on a Mac.
because you can't build for a different platform, at least not with distutils/setuptools. |
ad7496e
to
240975b
Compare
@sixninetynine I've tested this changes both with and without specifying Also, I cannot figure out why |
I actually simplified the wheel building step a bit by making it only specifically try to make wheels out of packages that wear downloaded as sdists, so it doesn't have to do any of that ugly filtering anymore. |
0f78c11
to
fdd2f15
Compare
fdd2f15
to
a3de887
Compare
I've resolved all the conflicts on this branch. @sixninetynine is there anything else you'd like to see here? |
Ugh, apparently there are real test failures now. I thought it was only the mypy thing again. I'll look into it. |
hey @dan-blanchard Right now I am hoping that pypa/pip#5404 is accepted/merged, which (combined with #34) ought to effectively implement this feature. |
Oh cool, I hadn't seen your PR to add options to |
hey @dan-blanchard just a heads up, my PR landed in pip.. if you upgrade your local pip (shiv lists pip as a dependency, but ensuring a specific version of pip is currently out of shiv's purview) then this functionality is supported when using bleeding edge pip. Once 18.1 is released it'll be more readily available: step 1: ensure you have latest bleeding edge pip
step 2: create a manylinux pyz (on osx!)
step 3: ship it over to a linux box
step 4: now run it (on linux)
|
@sixninetynine Awesome! Thanks for the tip. I'll close this PR since it's no longer necessary. |
I need to add tests and docs for this, but I just wanted to post this before the weekend since I've actually gotten it working.
The key changes are:
pip download
+wheel install
instead ofpip install
for installing wheels. This way you can force installation into a directory even with incompatible wheels, and you can rely onpip download
to get the correct wheels for a different platform.--python
exists, since you might be creating a.pyz
file for a different machine.map_shared_objects
where some internal.so
files used bynumpy
would break themodule_name
splitting code.If you want to try it out, just run:
I didn't add any special args for cross-platform stuff, since we can rely on the pip download flags.