Skip to content

Make wheels - #108

Merged
almarklein merged 5 commits into
imageio:masterfrom
blink1073:make-wheels
Oct 9, 2015
Merged

almarklein merged 5 commits into
imageio:masterfrom
blink1073:make-wheels

Conversation

@blink1073

Copy link
Copy Markdown

Fixes #91.

$ ls dist
imageio-1.3-py2.py3-linux_i386.whl
imageio-1.3-py2.py3-linux_x86_64.whl
imageio-1.3-py2.py3-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
imageio-1.3-py2.py3-win32.whl
imageio-1.3-py2.py3-win_amd64.whl

@blink1073

Copy link
Copy Markdown
Author

OSX is being irrationally difficult. My 2 cents would be to include the OSX library in the tarball and provide the other wheels.

@blink1073

Copy link
Copy Markdown
Author

I'm going to take a break from this: it is maddening.

@blink1073

Copy link
Copy Markdown
Author

Apparently PyPI completely blocks Linux wheels at the moment...

@blink1073

Copy link
Copy Markdown
Author

I'm calling this a dead end.

@blink1073 blink1073 closed this Jul 7, 2015
@blink1073 blink1073 mentioned this pull request Jul 7, 2015
@almarklein

Copy link
Copy Markdown
Member

Arg. Why is it so hard? Aren't many packages building and uploading wheels?

@almarklein

Copy link
Copy Markdown
Member

"Why is it so hard" not meant as a personal thing, but more like why is setuptools/pypi not making this easy for us...

@blink1073 blink1073 reopened this Jul 7, 2015
@blink1073

Copy link
Copy Markdown
Author

Okay, updated thoughts:
Release wheels for win64 and osx64 for py27 and py34 (I figured out the syntax).
Include the linux64 version in the tarball.
All other combinations would have to download the library separately (or automatically).

@blink1073

Copy link
Copy Markdown
Author

Note to self:
imageio-1.3-cp27-none-macosx_10_5_x86_64.whl
imageio-1.3-cp34-none-macosx_10_5_x86_64.whl
imageio-1.3-cp34-none-win_amd64.whl
imageio-1.3-cp27-none-win_amd64.whl

@blink1073

Copy link
Copy Markdown
Author

Here's my dist directory after running python setup.py sdist_all bdist_wheel_all:

$ ll dist
total 95336
-rw-r--r--  1 ssilvester  staff  4766656 Jul  9 11:05 imageio-1.3-cp27-none-macosx_10_5_x86_64.whl
-rw-r--r--  1 ssilvester  staff  4434964 Jul  9 11:05 imageio-1.3-cp27-none-win_amd64.whl
-rw-r--r--  1 ssilvester  staff  4766656 Jul  9 11:05 imageio-1.3-cp34-none-macosx_10_5_x86_64.whl
-rw-r--r--  1 ssilvester  staff  4434964 Jul  9 11:05 imageio-1.3-cp34-none-win_amd64.whl
-rw-r--r--  1 ssilvester  staff  5043110 Jul  9 11:06 imageio-1.3-linux32.zip
-rw-r--r--  1 ssilvester  staff  5114168 Jul  9 11:06 imageio-1.3-linux64.zip
-rw-r--r--  1 ssilvester  staff  4820461 Jul  9 11:06 imageio-1.3-osx64.zip
-rw-r--r--  1 ssilvester  staff  3205861 Jul  9 11:04 imageio-1.3-py3-none-any.whl
-rw-r--r--  1 ssilvester  staff  4290741 Jul  9 11:06 imageio-1.3-win32.zip
-rw-r--r--  1 ssilvester  staff  4488877 Jul  9 11:06 imageio-1.3-win64.zip
-rw-r--r--  1 ssilvester  staff  3231393 Jul  9 11:06 imageio-1.3.tar.gz
-rw-r--r--  1 ssilvester  staff   199552 Jul  9 11:06 imageio-1.3.zip

@almarklein

Copy link
Copy Markdown
Member

No wheels for Linux?

@almarklein

Copy link
Copy Markdown
Member

And what about 32bit? If its a matter of adding a few lines to make that work, why not? Or is there a problem I am overlooking?

I'd like to get rid of the sdist_all option if wheels work ok enough.

@blink1073

Copy link
Copy Markdown
Author

PyPI does not accept wheels for "Linux", so the the minimum set you could get is:

win32 wheels
win64 wheels
linux32 tar
osx wheels
tar with linux64
source zip

My intent with the previous list was to only provide eggs for the most common cases, and
provide an escape hatch for everyone else. For instance, win64 py33 users.

@almarklein

Copy link
Copy Markdown
Member

But in our case the cp34 wheels are exactly the same as our cp33 wheels since the binaries are not bound to a specific Python version. Can we just copy+rename in these cases?

@blink1073

Copy link
Copy Markdown
Author

Producing the wheels is not the problem, its just thriwing more build options together. Want me to add all possible valid combinations?

—
Sent from Mailbox

On Mon, Jul 13, 2015 at 3:41 AM, Almar Klein [email protected]
wrote:

But in our case the cp34 wheels are exactly the same as our cp33 wheels since the binaries are not bound to a specific Python version. Can we just copy+rename in these cases?

Reply to this email directly or view it on GitHub:
#108 (comment)

@almarklein

Copy link
Copy Markdown
Member

What do you mean by build options? Can we not just have bdist_wheel_all produce wheels for all combinations? What I meant is that from imageio-1.3-cp27-none-win_amd64.whl we can easily create a wheel for any Python version. So basically you can create 4 wheels and then copy+rename them for all Python versions that we want to support.

Or is the python version also included as meta info inside the wheel?

@blink1073

Copy link
Copy Markdown
Author

Ah, yes, that will work because when it builds we have the following created file:

$ cat WHEEL
Wheel-Version: 1.0
Generator: bdist_wheel (0.24.0)
Root-Is-Purelib: true
Tag: py2-none-any
Tag: py3-none-any

So it will grab the correct file based on name and install no matter what the underlying platform is.

@blink1073

Copy link
Copy Markdown
Author

Here's what the Pillow files look like:

Pillow-2.9.0-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Pillow-2.9.0-cp34-none-win32.whl
Pillow-2.9.0-cp34-none-win_amd64.whl

@blink1073

Copy link
Copy Markdown
Author

And for whatever reason the 2.7 Mac wheel is different:

Pillow-2.9.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl

@blink1073

Copy link
Copy Markdown
Author

Let's bear in mind that libfreeimage is available on Homebrew, MacPorts, Debian, and soon Anaconda. Are we fighting a battle that does not need to be be fought on Mac and Linux?

@matthew-brett

Copy link
Copy Markdown

I'm trying to build a wheel-building repo :

https://github.com/MacPython/imageio-wheels

I can now build (on travis) a dual arch Freeimage dylib, that should work on OSX 10.6, as OSX wheels require.

But - where should I copy this dylib into the imageio directory tree in order to build the wheel?

I currently copy into the imageio directory, but should it go into resources?

@matthew-brett

Copy link
Copy Markdown

@blink1073

Copy link
Copy Markdown
Author

Yep:

$ pip install imageio-1.3-cp27.cp34-none-macosx_10_5_x86_64.whl
Requirement already satisfied (use --upgrade to upgrade): imageio==1.3 from file:///Users/ssilvester/workspace/imageio/dist/imageio-1.3-cp27.cp34-none-macosx_10_5_x86_64.whl in /Users/ssilvester/anaconda/lib/python3.4/site-packages

@blink1073

Copy link
Copy Markdown
Author

@almarklein, I switched to python make test unit, but I'm still seeing four errors: https://travis-ci.org/blink1073/imageio-wheels/builds/79024328.

The three failures in test_avbin.py are occurring locally on my machine as well.

@almarklein

Copy link
Copy Markdown
Member

@blink1073 is that testing with a wheel or something? Not sure what to do with avbin. Maybe mark as known fails for now? Any idea why tempfile is imported? If it is expected, you can modify that test to ignore it.

@blink1073

Copy link
Copy Markdown
Author

@almarklein, those tests were on my local install on OSX 10.10.5.

@almarklein

Copy link
Copy Markdown
Member

But the Travis run, was it on imageio + modifications? I mean, so far Travis ran through the avbin tests ok. Any idea why not now?

@blink1073

Copy link
Copy Markdown
Author

I assumed the MacPython builds were running on OSX, is that right @matthew-brett?

@matthew-brett

Copy link
Copy Markdown

Yes, right, they are running on an 10.9 OSX VM.

@almarklein

Copy link
Copy Markdown
Member

Ah, I did not realize it was a Travis mac run. I say just disable avbin tests on OSX for now. It's interesting though, because the person who contributed tje avbin plugin is a mac user.

@blink1073

Copy link
Copy Markdown
Author

I don't think skipping the tests is the right way to go, if the plugin can't read properly on OSX, it should at least indicate this to the user rather than failing because it can't read the metadata.

@almarklein

Copy link
Copy Markdown
Member

So, are you suggesting to catch this error and raise using an exception with a more descriptive message?

@blink1073

Copy link
Copy Markdown
Author

Yeah, I think that is a fair compromise.

@blink1073

Copy link
Copy Markdown
Author

The problem is in the use of the alpha version of libavbin. I downloaded libavbin.10.dylib and the tests pass.

@blink1073

Copy link
Copy Markdown
Author

@almarklein, would you accept a PR to this repo and imageio-binaries with version 10?

@almarklein

Copy link
Copy Markdown
Member

I just did :)

@blink1073

Copy link
Copy Markdown
Author

@blink1073

Copy link
Copy Markdown
Author

I verified that the wheel installs for me and functions correctly.

@blink1073

Copy link
Copy Markdown
Author

Also works on python 3.5 if I add that to the name 😄

@almarklein

Copy link
Copy Markdown
Member

Sweet! How is it generated? Can we do t from imageio's setup.py?

@blink1073

Copy link
Copy Markdown
Author

The wheel is generated by https://github.com/MacPython/imageio-wheels, we just need to update the submodule when we want to build a new version, then grab the wheel and rename it.

@almarklein

Copy link
Copy Markdown
Member

and then manually update that wheel to pypi?

@blink1073

Copy link
Copy Markdown
Author

@matthew-brett, how do you deploy the OSX wheels for scikit-image?

@matthew-brett

Copy link
Copy Markdown

@blink1073

Copy link
Copy Markdown
Author

Sounds reasonable, I'd need to update the file name in MacPython/imageio-wheels.

@almarklein

Copy link
Copy Markdown
Member

Sweet! Does this mean the wheel-building is ready? Maybe we should document somewhere (in setup.py?) how we can build and deploy the wheels.

@blink1073

Copy link
Copy Markdown
Author

IMHO, we should just use setup.py (with the latest commit), since we are not "compiling" for either platform every time.

almarklein added a commit that referenced this pull request Oct 9, 2015
@almarklein
almarklein merged commit 2dbc4ae into imageio:master Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants