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

How to install Pillow for PyPy on Travis CI? #570

Closed
hugovk opened this issue Mar 25, 2014 · 3 comments
Closed

How to install Pillow for PyPy on Travis CI? #570

hugovk opened this issue Mar 25, 2014 · 3 comments

Comments

@hugovk
Copy link
Member

hugovk commented Mar 25, 2014

I understand Pillow should be supported for Pypy (e.g. see #67 and https://bitbucket.org/pypy/compatibility/wiki/Home).

See this build of Pillow. Python 2.x and 3.x pass, but PyPy errors:
https://travis-ci.org/hugovk/Pillow/builds/21429853

The only change is adding "pypy" to .travis.yml as an allowed failure:
hugovk@2bbc7f0

All 98 tests fail with PyPy because of a failing python setup.py clean (see https://travis-ci.org/hugovk/Pillow/jobs/21429858):

$ pip install cffi
Requirement already satisfied (use --upgrade to upgrade): cffi in /usr/local/pypy/lib_pypy
Cleaning up...
$ python setup.py clean
Traceback (most recent call last):
  File "app_main.py", line 72, in run_toplevel
  File "setup.py", line 82, in <module>
    import _tkinter
  File "/usr/local/pypy/lib_pypy/_tkinter/__init__.py", line 13, in <module>
    from .tklib import tklib, tkffi
  File "/usr/local/pypy/lib_pypy/_tkinter/tklib.py", line 137, in <module>
    library_dirs = libdirs
  File "/usr/local/pypy/lib_pypy/cffi/api.py", line 339, in verify
    lib = self.verifier.load_library()
  File "/usr/local/pypy/lib_pypy/cffi/verifier.py", line 75, in load_library
    return self._load_library()
  File "/usr/local/pypy/lib_pypy/cffi/verifier.py", line 151, in _load_library
    return self._vengine.load_library()
  File "/usr/local/pypy/lib_pypy/cffi/vengine_gen.py", line 66, in load_library
    module = backend.load_library(filename)
OSError: Cannot load library /usr/local/pypy/lib_pypy/_tkinter/__pycache__/_cffi__g23e32416x3547cfed.pypy-22.so: libtcl8.5.so.0: cannot open shared object file: No such file or directory
The command "python setup.py clean" exited with 1.
$ python setup.py build_ext --inplace
Traceback (most recent call last):
  File "app_main.py", line 72, in run_toplevel
  File "setup.py", line 82, in <module>
    import _tkinter
  File "/usr/local/pypy/lib_pypy/_tkinter/__init__.py", line 13, in <module>
    from .tklib import tklib, tkffi
  File "/usr/local/pypy/lib_pypy/_tkinter/tklib.py", line 137, in <module>
    library_dirs = libdirs
  File "/usr/local/pypy/lib_pypy/cffi/api.py", line 339, in verify
    lib = self.verifier.load_library()
  File "/usr/local/pypy/lib_pypy/cffi/verifier.py", line 75, in load_library
    return self._load_library()
  File "/usr/local/pypy/lib_pypy/cffi/verifier.py", line 151, in _load_library
    return self._vengine.load_library()
  File "/usr/local/pypy/lib_pypy/cffi/vengine_gen.py", line 66, in load_library
    module = backend.load_library(filename)
OSError: Cannot load library /usr/local/pypy/lib_pypy/_tkinter/__pycache__/_cffi__g23e32416x3547cfed.pypy-22.so: libtcl8.5.so.0: cannot open shared object file: No such file or directory

The command "python setup.py build_ext --inplace" exited with 1.

The command "python setup.py build_ext --inplace" exited with 1.
$ python selftest.py
Traceback (most recent call last):
  File "app_main.py", line 72, in run_toplevel
  File "selftest.py", line 11, in <module>
    from PIL import Image, ImageDraw, ImageFilter, ImageMath
  File "/home/travis/build/hugovk/Pillow/PIL/Image.py", line 53, in <module>
    from PIL import _imaging as core
ImportError: cannot import name '_imaging'
The command "python selftest.py" exited with 1.

Is the problem with Pillow's setup, Pillow's Travis config, Travis CI itself or PyPy?

This isn't a priority for me, I just noticed Pypy is available on Travis so added it to my build. Here's a failing pip install Pillow with PyPy:
https://travis-ci.org/hugovk/pixel-tools/jobs/21493553

@wiredfool
Copy link
Member

I think it's a Travis thing. There's a bit in the do somewhere that mentions that installing or building c extensions on pypy will fail. (http://docs.travis-ci.com/user/languages/python/#PyPy-Support)

The tests all pass on pypy on my local machine ( or at least they did a month ago)

@hugovk
Copy link
Member Author

hugovk commented Mar 25, 2014

I just found this issue on the Travis CI repo travis-ci/travis-ci#1654 and they think it's a PyPy issue.

But I've just tried some things and Pillow installed for PyPy on Travis and all the tests passed:
https://travis-ci.org/hugovk/Pillow/builds/21522757

All that was needed was a "sudo apt-get install python-tk" in the .travis.yml. I'll make a PR.

But perhaps the install should only happen for the PyPy build, what do you think? And should PyPy be an allowed failure or would you prefer a normal build?

@squeaky-pl
Copy link

AFAIK there is pypy-tk package if you want to use tkinter under PyPy. Tk support package is separated to follow CPython packaging practices since it is rarely used.

zmwangx added a commit to zmwangx/storyboard that referenced this issue May 11, 2015
But not holding my breath, since there's documented problems with Pillow
on Travis's PyPy: python-pillow/Pillow#570
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

No branches or pull requests

4 participants