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

Conversation

flacjacket
Copy link
Contributor

Import the built ffi modules from cairocffi._ffi rather that ._ffi, so that if the package has been installed, this will pick up the compiled modules that are installed rather than insisting they be re-built in the source directory. This has the unfortunate side-effect of possibly hiding any problems if the cdefs are changed but the package is not re-built in the source tree.

Also, get the XCB tests running on Travis, though they will be xfailed until Travis bumps to Ubuntu 14.04.

Import the built ffi modules from `cairocffi._ffi` rather that `._ffi`,
so that if the package has been installed, this will pick up the
compiled modules that are installed rather than insisting they be re-built
in the source directory. This has the unfortunate side-effect of possibly
hiding any problems if the cdefs are changed but the package is not
re-built in the source tree.
But let xfail for Travis' cairo version from Ubuntu 12.04
@flacjacket flacjacket mentioned this pull request Jun 3, 2015
@flacjacket flacjacket changed the title Enable ffi import when package pip installed Allow ffi import when package pip installed Jun 3, 2015
@SimonSapin
Copy link
Member

This doesn’t fix the issue described at #60 (comment) . The output is the same. You can try it with pip install tox and then e.g. tox -e py27. See https://github.com/SimonSapin/cairocffi/blob/master/tox.ini

@flacjacket
Copy link
Contributor Author

Hmm, if I do that then ls .tox/py27/lib/python2.7/site-packages/cairocffi/, I see that _ffi.py and _ffi_pixbuf.py are both there, but they aren't found when tox runs py.test. If I run .tox/py27/bin/python cairocffi/ffi_build.py, re-running the tests, I can get the tests to pass. The problem is tox uses the root cairocffi directory to run the tests, not the installed cairocffi directory. If I apply this:

diff --git a/tox.ini b/tox.ini
index caced90..052754c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -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

to explicitly run from the site-packages installation rather than the source, I get tox to pass.

@SimonSapin SimonSapin closed this in e374c44 Jun 5, 2015
@SimonSapin
Copy link
Member

The problem is tox uses the root cairocffi directory to run the tests, not the installed cairocffi directory.

That was it, good catch. I cherry-picked one of your commits but did the rest different: e374c44

The XCB test have been unreliable for me, though. Sometimes the python process gets killed with SIGABRT.

@flacjacket
Copy link
Contributor Author

That looks good, thanks for cleaning that up.

Were you getting errors with any version in particular? I was having some problems with 2.7 while I was trying to get tox running, but it may have been how I was getting it to run. I can try to look into it.

If there's nothing else, is there any chance of getting a point release soon? We need to do the same cffi 1.0 changeover in Qtile, and since we use cairocffi for some drawing, we need to depend on a version that also uses out-of-line cffi. Thanks.

@SimonSapin
Copy link
Member

No, pretty much all Python versions tested were affected by this SIGABRT… sometimes.

I was kinda lazy to write the changelog, but I just uploaded 0.7 to PyPI without it.

@flacjacket
Copy link
Contributor Author

Hmm, alright, I can play around with it and come back if I can find
anything. Thanks!

On Fri, Jun 5, 2015 at 11:20 AM, Simon Sapin notifications@github.com
wrote:

No, pretty much all Python versions tested were affected by this SIGABRT…
sometimes.

I was kinda lazy to write the changelog, but I just uploaded 0.7 to PyPI
without it.


Reply to this email directly or view it on GitHub
#61 (comment).

@flacjacket flacjacket mentioned this pull request Jul 16, 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.

2 participants