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

Allow ffi import when package pip installed #61

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ python:
- "3.3"
- "3.4"
- "pypy"
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
install:
- "pip install xcffib"
- "pip install ."
- "python -c 'import cffi, sys; sys.exit(cffi.__version_info__[0])' || python cairocffi/ffi_build.py"
script: "py.test"
sudo: false
2 changes: 1 addition & 1 deletion cairocffi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from .compat import FileNotFoundError

try:
from ._ffi import ffi
from cairocffi._ffi import ffi
except ImportError:
# PyPy < 2.6 compatibility
from .ffi_build import ffi
Expand Down
2 changes: 1 addition & 1 deletion cairocffi/pixbuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .compat import xrange

try:
from ._ffi_pixbuf import ffi
from cairocffi._ffi_pixbuf import ffi
except ImportError:
# PyPy < 2.6 compatibility
from .ffi_build import ffi_pixbuf as ffi
Expand Down
10 changes: 4 additions & 6 deletions cairocffi/test_xcb.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,9 @@ def create_gc(conn):
return gc


@pytest.mark.xfail(cairo_version() < 11200,
reason="Cairo version too low")
def test_xcb_pixmap(xcb_conn):
if cairo_version() < 11200:
pytest.xfail()

width = 10
height = 10

Expand Down Expand Up @@ -156,10 +155,9 @@ def test_xcb_pixmap(xcb_conn):
event = xcb_conn.poll_for_event()


@pytest.mark.xfail(cairo_version() < 11200,
reason="Cairo version too low")
def test_xcb_window(xcb_conn):
if cairo_version() < 11200:
pytest.xfail()

width = 10
height = 10

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ envlist = py26-cairo-1.8.2, py26-cairo-1.10.0, py26, py27, py32, py33, py34, pyp
deps=
pytest
xcffib
commands=py.test []
commands=py.test [] {envsitepackagesdir}/cairocffi

[testenv:py26-cairo-1.8.2]
; Building old cairo on an modern system might require setting
Expand Down