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

Add ctypes support for python3's recipe #1465

Merged
merged 1 commit into from
Dec 3, 2018

Conversation

opacam
Copy link
Member

@opacam opacam commented Nov 18, 2018

Should be mentioned that the current test app for python3 has been modified by adding libffi to the requirements because the ui for the app has some button to test the ctypes module.

Note: This is the pull request #1463 cleaned up, with documentation and with the commits squashed into one single commit

AndreMiras
AndreMiras previously approved these changes Nov 18, 2018
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking very good thanks!
FYI, rather than creating a new PR. You could have amend/squash your changes of #1463 and push force to your branch. That way we keep the review history on a single PR.

@opacam
Copy link
Member Author

opacam commented Nov 18, 2018

You could have amend/squash your changes of...

I do know @AndreMiras, but I though that it was not recommended to force push to public repos and (I usually give administrators access to all my prs...but honestly...I don't know how far goes that git feature)... that is why I proceed this way...it seemed easier to me at that moment to create a new pr because I already had a new branch with the recipe cleaned up, anyway, what commands do you use to amend/squash?

@tshirtman
Copy link
Member

tshirtman commented Nov 18, 2018

i usually use git rebase -i master then edit the select commits and tell git to squash them in the editor window it opens, another — more blunt — way is to use git stash && git reset master && git commit -a again, this creates one commit with all the changes.

but it's not a big deal, we can also squash on merge through the interface if we want to.

@KeyWeeUsr
Copy link
Contributor

More practical option is git rebase -i HEAD~N where N is number of commits - 1 for rebasing. This way you can get back in time. Let's say you have 50 commits and after a 15th commit in e.g. 5 commits you have some hardcoded credentials or whatever. Just choose the commits for edit or multiple other options rebase allows you to do. While "back in time" (pun) you can also create new commits e.g.:

edit hash something   <- while checked out here
pick hash whatever

then

git add <file>&&git commit -m "New commit"&& git rebase --continue

or some fixes before, depending on what git status tells you. There are explicit options for squashing into one commit, editing + squashing and many more. Just open the documenation :)

For an ordinary rebase to pull your commits on the HEAD of some branch you can use git rebase <branch>.

@AndreMiras
Copy link
Member

Nope you don't need specific access since you do it on your fork, but it still update the PR.
There're various ways to do it. I often use soft reset with HEAD~<N>.
Or I just directly git add and git amend. Anything that works for you works for us 😄

@opacam
Copy link
Member Author

opacam commented Nov 18, 2018

¡¡¡Many thanks guys, for all the instructions, you pointed me to the right direction!!!

I was investigating the rebase command and I found this tutorial that clarifies all the commands mentioned:

https://www.atlassian.com/git/tutorials/merging-vs-rebasing

Ahhh...and very sorry "about the the review history" 😅..this will not happen anymore 💪

Should be mentioned that the current test app for python3 has been modified by adding libffi to the requirements because the ui for the app has some button to test the ctypes module.
@opacam opacam force-pushed the python3-ctypes-support branch from 01e7716 to 0fec438 Compare November 19, 2018 12:24
opacam added a commit to opacam/python-for-android that referenced this pull request Nov 19, 2018
Actions taken:

  - I found that a lot of basic python modules get not compiled. Here we solve that issue by creating a patch (fix-missing-extensions.patch) adapted from the one applied to the python3's master branch. This new patch replaces the "fix-modules-initialization" (which worked but not compiled the necessary modules into .so files). Now all the needed modules should be present.

    * Note: **Should be mentioned that the ctypes module builds without a problem for python2 (no need to link with custom libffi as we do in python 3 in pr kivy#1465)**

  - I reviewed all the patches to move all the unneeded into a sub folder (maybe we can need some of them...)

    * Note: all the patches where made to be applied into the old python2's build system, and only those which allows the native build to succeed and the ones which fix python initialization should be needed with the new build system

  - Rename patches to be clear and to remove some upper cases and versions (we will not have many more future versions for python2 and I think that removing this versions make the code more readable)
opacam added a commit to opacam/python-for-android that referenced this pull request Nov 25, 2018
Actions taken:

  - I found that a lot of basic python modules get not compiled. Here we solve that issue by creating a patch (fix-missing-extensions.patch) adapted from the one applied to the python3's master branch. This new patch replaces the "fix-modules-initialization" (which worked but not compiled the necessary modules into .so files). Now all the needed modules should be present.

    * Note: **Should be mentioned that the ctypes module builds without a problem for python2 (no need to link with custom libffi as we do in python 3 in pr kivy#1465)**

  - I reviewed all the patches to move all the unneeded into a sub folder (maybe we can need some of them...)

    * Note: all the patches where made to be applied into the old python2's build system, and only those which allows the native build to succeed and the ones which fix python initialization should be needed with the new build system

  - Rename patches to be clear and to remove some upper cases and versions (we will not have many more future versions for python2 and I think that removing this versions make the code more readable)
opacam added a commit to opacam/python-for-android that referenced this pull request Nov 25, 2018
Actions taken:

  - I found that a lot of basic python modules get not compiled. Here we solve that issue by creating a patch (fix-missing-extensions.patch) adapted from the one applied to the python3's master branch. This new patch replaces the "fix-modules-initialization" (which worked but not compiled the necessary modules into .so files). Now all the needed modules should be present.

    * Note: **Should be mentioned that the ctypes module builds without a problem for python2 (no need to link with custom libffi as we do in python 3 in pr kivy#1465)**

  - I reviewed all the patches to move all the unneeded into a sub folder (maybe we can need some of them...)

    * Note: all the patches where made to be applied into the old python2's build system, and only those which allows the native build to succeed and the ones which fix python initialization should be needed with the new build system

  - Rename patches to be clear and to remove some upper cases and versions (we will not have many more future versions for python2 and I think that removing this versions make the code more readable)
@inclement
Copy link
Member

inclement commented Dec 3, 2018

Closing as merged in #1463. Thanks again!

Edit: it looks like the doc was omitted from that PR, did you want to merge that here?

@inclement inclement closed this Dec 3, 2018
@inclement inclement reopened this Dec 3, 2018
@inclement inclement merged commit 1ee34ad into kivy:master Dec 3, 2018
@inclement
Copy link
Member

Actually I misread the other issue, so merging instead :)

Thanks!

@inclement inclement mentioned this pull request Dec 3, 2018
6 tasks
@opacam opacam deleted the python3-ctypes-support branch June 15, 2019 11:30
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.

5 participants