-
Notifications
You must be signed in to change notification settings - Fork 95
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
Update/kivent revival: Take 2! #281
Conversation
Travis is up and running- Windows is next on the docket. |
Currently Cymunk doesnt install in windows/python3.5+ environments, which is a dealbreaker for KivEnt/modules/cymunk working in modern envionments. Remove testing of cymunk until cymunk is fixed (see kivy/cymunk#52)
Cymunk looks like it has been broken in windows based python 3.5+ environments for a while: I'm not a Windows guy so I don't have great knowledge of how to just go fix it, nor do I have great test environments to make up meaningful workarounds. So I did what any good engineer does and kick the can down the road. i.e. I conditionalized out the cymunk install. Yes, this is a cop out, but this will allow us to testing building four of the five KivEnt modules in windows/python3.5, which is not nothing. |
Hello tim-win, Thanks for the work, I'd love to try this out. What would be a working combination of cymunk and kivent, version wise ? I cannot get anything to work here. I have kivy-kivent-4709f07 and kivy 1.11.1 Thanks, Arian |
Hey jwasys! You'll need cymunk straight from the GitHub.com/kivy/cymunk repo, and I build latest master for github.com/kivy/kivy as well. You need to build extensions for kivy in place for the kivent build to find the ,cyx files, and will also need to add the kivy and cymunk builds to your pythonpath. Writing all of that out on a phone, maybe I should update the readme with install instructions! |
Also, 4709f07 is incompatible with kivy 1.11, you'll need to use this branch to get it running! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't test, but from reading, it seems good to me, given the current lack of maintenance on this project, i'm all for letting people pushing it forward, so assuming it works for you, i'm ok with merging it.
Good job, very welcome.
Hello tim-win Instructions would be great since I've been swimming for too long now... Thanks Arian |
Yes! A positive review! I don't have access to merge to this repo / branch, as master is protected here, but please let me know if there's anything I can do to help. |
Arian- Happy to update the readmes next. I think there's a fair amount of house cleaning that can be done here, but I'd like to call this PR complete for now as it does get PR tests back into shape. |
I was able to build under Windows. Check core(2_basic_app) and cymunk(6_controlling_the_viewing_area). |
Major Changes required to get KivEnt back up and running:
on_kv_post
KivEnt examples almost all follow this pattern:
Combined with a .kv file that defines a gameworld:
However, new functionality in Kivy includes moving kv rule application to a callback to give developers more control. You can see the implementation here.
This is a breaking change, which is why I recommend bumping KivEnt to version 3.0- as far as I can tell everything will need to be updated to support this new pattern. However, after adding the
on_kv_post
method to cwidget, the fix is very straightforward for user code: just move the init gameworld call and you're on your way:All but the
0_empty_kivy_app
examples were affected by this and have since been fixed.Relative Imports
Implicit relative imports have been removed in Kivy to support newer versions of python, and KivEnt is awash with them. As an example fix:
This PR cleans up relative imports throughout KivEnt. Addresses #265 and #209
Print > Logger, when Possible
Compilation was broken on python 3+ due to at least two uses of print statements in KivEnt, but several locations were cleaned up to just use the kivy Logger instead of print.
Fix the Pull Request Tests
PR tests were fixed. Travis and Appveyor both have approved this pull request.
Travis tests were moved from trusty to xenial, and the python versions were changed to 3.5, 3.6, and 3.7.
Appveyor was changed to the same python layout, and the target Kivy version upstream was pinned to 2.0.0.dev0 (rather than 1.10.1.dev0, which no longer exists in appveyor).
Also, cymunk is not correctly compiling in Windows/Python3.5+ environments. This is documented pretty well here and also discussed here. As I'm not familiar with Windows build systems, I don't have a good test environment to try to fix this, this is a long standing issue, and I have to wash my hair tonight- I decided to dodge this issue.
The KivEnt/modules/cymunk install is conditionalized out.
Other Small changes
Then a bunch of little things.
** This change meets semver.org's recommendation for new major versions, as it is backwards incompatible with old KivEnt builds due to the on_post_kv issue
scripts/install_all.sh
file, which is handy as heck.** I couldn't determine when this change occurred, but several calls to
len
were returning doubles, and then being saved to integer vars in kivy or elsewhere. This choked the cythonization so I went and fixed it.*_disabled
methods from Kivy to cwidget. Addresses Kivent objects (widgets) do not have attribute 'dec_disabled' #27615_rotate_camera
example pretty thoroughly, because I couldn't figure out if it was rotating the camera in its original form. Once I could prove the camera rotation worked, it was only a little bit of cleanup to get the example to its current form.To-Do before this can be merged: