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

Fixes for Cython 0.27 #5406

Merged
merged 7 commits into from
Oct 17, 2017
Merged

Fixes for Cython 0.27 #5406

merged 7 commits into from
Oct 17, 2017

Conversation

KeyWeeUsr
Copy link
Contributor

Based on #5390 and trying to fix remaining issues. While it seems to be ok on py2, py3 for whatever reason tries to say kivy.graphics.instructions isn't available (it is actually ô_ô). Perhaps the error means I'm not on the right track?

scoder and others added 6 commits September 21, 2017 10:42
…uire it.

This will become an error in Cython 0.27, as it would depend on the type that Cython thinks it is calling (base or subtype) whether exceptions will be handled by the caller or not.
@scoder
Copy link
Contributor

scoder commented Sep 26, 2017

Note how it says kivy.graphics.instructions., with a dot at the end. Maybe that is the problem?

@scoder
Copy link
Contributor

scoder commented Sep 26, 2017

Note that in CPython 3.5 and later, Cython now follows PEP 489 to improve the behaviour of module code. It is now very similar to Python modules, which also impacts relative imports, for example. Might be related.

@scoder
Copy link
Contributor

scoder commented Sep 29, 2017

FYI, 0.27.1 will disable PEP-489 support again. It has proven to cause too much instability on user side.

@KeyWeeUsr
Copy link
Contributor Author

@scoder thanks for notifying! However, I guess you'd like to get it going asap? If that's the case, it's quite an issue for us. :)

@scoder
Copy link
Contributor

scoder commented Sep 30, 2017

I guess you'd like to get it going asap?

I guess you mean that we'd re-enable PEP-489? At some point, sure, but probably as an opt-in, or at least with safer defaults. Module reloading, for example, might not be allowed without user interaction.

You can try the latest Cython master branch, it's essentially 0.27.1 already.

@scoder
Copy link
Contributor

scoder commented Sep 30, 2017

Note that I would still recommend using proper relative imports (from . import xyz) in your modules, and preferably also from __future__ import absolute_import. It's cleaner and also faster, because it avoids relative directory searches for globally installed modules.

@KeyWeeUsr
Copy link
Contributor Author

@scoder I agree we need to fix it, I was just confirming the tests pass again i.e. that it's the PEP489 we had an issue with (I somewhat doubt it).

@matham I changed fromlist to fromlist='*' which apparently fixed our issue with the new stable Cython version. We tend to limit exported symbols with __all__, however it's ignored all the same, therefore it shouldn't do much harm. I'm rather curious what exactly did it change for Factory because I'm apparently missing the result as the imports work the same:

Layout = __import__(name='kivy.uix.boxlayout', fromlist='*').Layout
Layout = __import__(name='kivy.uix.boxlayout', fromlist='.').Layout
import kivy.uix.boxlayout as b; Layout = b.Layout

although Layout isn't present in the __all__.

@KeyWeeUsr
Copy link
Contributor Author

Anyone anything against? Tested with buildozer and seems to work fine.

@KeyWeeUsr KeyWeeUsr merged commit 7f51b77 into kivy:master Oct 17, 2017
@KeyWeeUsr KeyWeeUsr deleted the scoder-patch-1 branch October 17, 2017 20:00
@inclement
Copy link
Member

\o/

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