nanobox-io / nanobox-engine-python

Engine for running Python apps on Nanobox
https://nanobox.io
MIT License
12 stars 13 forks source link

Provide dependencies for Pillow by default #31

Open jjkester opened 7 years ago

jjkester commented 7 years ago

Pillow is the go-to Python package for image manipulation. For example, Django requires it when using model fields for images. Currently it is kind of a hassle to get working due to the fact that it requires quite some packages to install properly (probably to compile the bindings). Therefore it would be nice if these dependencies would be installed automagically.

The documentation has a very comprehensive list of dependencies: https://pillow.readthedocs.io/en/4.1.x/installation.html#building-from-source

As can be seen, not all packages are strictly required, however, I would recommend just installing them all so there are no nasty surprises when people think all features are supported.

After some experimentation I can verify that Pillow compiles when I add the following extra packages to my boxfile (although this list is probably not complete for full support, also, it might install more than strictly necessary):

run.config:
  engine: python
  engine.config:
    runtime: python-3.6
  extra_packages:
    - libjpeg-turbo
    - tiff
    - zlib
    - freetype2
    - lcms2
    - libwebp
    - tcl
    - tk

Another option of course is just providing a precompiled version of Pillow, but I am not sure how that would work in combination with the requirements file and pip.