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

Make this work with python 3.4 as well as 2.7 #164

Merged
merged 13 commits into from
Nov 3, 2015

Conversation

benson-basis
Copy link
Contributor

Also use dlopen on Mac and Linux, and clean up a number of other things.

@tshirtman
Copy link
Member

This seems to fix/touch a wide range of things, and there are multiple "fixup" commits, it would be better to separate it in different PRs and squashing the fixups in the relevant commits. Are you familiar enough with git for that?

Thanks for your contribution!

@benson-basis
Copy link
Contributor Author

If you are willing to take my changes, I'm willing to neaten them up. Please pick up my smaller PRs, which I think are sufficiently tight (or tell me what they need). I'll then tee up one or two more ahead of the Python3 changes, and at the end of this process there will be a nice, clean, commit here for you to take .

@haricot
Copy link

haricot commented Oct 13, 2015

Build Status

@dessant
Copy link
Contributor

dessant commented Oct 13, 2015

@tito plop

@tito
Copy link
Member

tito commented Oct 13, 2015

@dessant feel free to handle the maintenance (pr and merge) :)

@dessant
Copy link
Contributor

dessant commented Nov 3, 2015

@benson-basis please rebase and i'll merge right away if it passes py3 tests.

Conflicts:
	.travis.yml
	Makefile
	setup.py
	tests/test_proxy.py
@benson-basis
Copy link
Contributor Author

I merged; it passes 'make tests PYTHON3=1' for me --- on my mac. I haven't
tried anything on Linux.

On Tue, Nov 3, 2015 at 7:04 AM, dessant notifications@github.com wrote:

@benson-basis https://github.com/benson-basis please rebase and i'll
merge right away if it passes py3 tests.


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

@dessant
Copy link
Contributor

dessant commented Nov 3, 2015

It seems to fail both with py2 and 3 on linux.

@benson-basis
Copy link
Contributor Author

I'll start up a VM and sort it.

On Tue, Nov 3, 2015 at 8:19 AM, dessant notifications@github.com wrote:

It seems to fail both with py2 and 3 on linux.


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

@dessant
Copy link
Contributor

dessant commented Nov 3, 2015

@benson-basis thanks a bunch for taking care of this, and sorry for the long silence.

This project is in great need of a maintainer, if you would like to contribute beyond this pr, we would be glad to give you access.

@benson-basis
Copy link
Contributor Author

Hmm. On my linux VM, the python2 test worked once I pip installed future.
I'm struggling to get cython to install on that box.

As for the future, I did all this work when I had a problem that it solved.
I'm not so sure now if I still have that problem, I'll let you know.

On Tue, Nov 3, 2015 at 8:35 AM, dessant notifications@github.com wrote:

@benson-basis https://github.com/benson-basis thanks a bunch for taking
care of this, and sorry for the long silence.

This project is in great need of a maintainer, if you would like to
contribute beyond this pr, we would be glad to give you access.


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

@benson-basis
Copy link
Contributor Author

@dessant Looks like I cured what ailed it.

@dessant
Copy link
Contributor

dessant commented Nov 3, 2015

@benson-basis, awesome work, thanks again!

dessant added a commit that referenced this pull request Nov 3, 2015
Make this work with python 3.4 as well as 2.7
@dessant
Copy link
Contributor

dessant commented Nov 4, 2015

Some users are reporting failed installations and apk packaging also seems to fail after the merge. @benson-basis, @haricot were you able to build an apk with your branches?

A different problem is the usage of future, which is a ~ 1.6 MB package, this makes it a bit heavy for Android deployment. A better alternative could be six.

These issues must be sorted out quickly because buildozer uses pyjnius master, so this is reaching and breaking things for many people. The other option is to revert the pr.

@benson-basis
Copy link
Contributor Author

@dessant I don't know anything about apks. I don't know how to build one -- I don't even know if I have the tools to build one on any of my systems. Can you give me a hint? If you need to revert on master, how about you go ahead and add bimargulies (not this account) so I can maintain a branch until this sorts out?

@benson-basis
Copy link
Contributor Author

The android install instructions don't seem believable to me. They don't mention the NDK at all.

@Kovak
Copy link

Kovak commented Nov 4, 2015

@benson-basis
Copy link
Contributor Author

@dessant @Kovak I'm sorry to be sense, but how does python-for-android invoke setup.py? The doc here says to run distribute.sh, but no such script is in the repo.

@dessant
Copy link
Contributor

dessant commented Nov 4, 2015

I would be in favor of trying to fix master before resorting to keeping a separate branch. I see you've already taken steps to clean up master. Did the p4a docs help in the end? I don't have experience with android, but @inclement should be able to give you feedback.

@benson-basis
Copy link
Contributor Author

The docs were, in the end, enough of a hint. I still think someone forgot
to commit that shell script.

Until I know the precise p-f-a command that the other folks need to work, I
can't verify that it works. So far, all I know is that 'create' works.

On Wed, Nov 4, 2015 at 8:22 AM, dessant notifications@github.com wrote:

I would be in favor of trying to fix master before resorting to keeping a
separate branch. I see you've already taken steps to clean up master. Did
the p4a docs help in the end? I don't have experience with android, but
@inclement https://github.com/inclement should be able to give you
feedback.


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

@dessant
Copy link
Contributor

dessant commented Nov 4, 2015

distribute.sh is part of the old p4a toolchain, it should not be needed for the guide linked above.
If create succeeded, you should have an apk somewhere.

@benson-basis
Copy link
Contributor Author

I don't think that create makes apks. The doc says that apks are a separate
process, and require additional arguments.

Can someone who is trying to consume this stuff chime in and say what,
exactly, they do with p-f-a?

On Wed, Nov 4, 2015 at 8:38 AM, dessant notifications@github.com wrote:

distribute.sh is part of the old p4a toolchain, it should not be needed
for the guide linked above.
If create succeeded, you should have an apk somewhere.


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

@inclement
Copy link
Member

Yeah, the create command only makes an android dist, but this should be enough to test that pyjnius compiles. You can use the apk command afterwards to make an apk from this dist.

@benson-basis
Copy link
Contributor Author

I would like to know how the consumers of this package use the apk
command so I can repro what they do.
On Nov 4, 2015 10:35 AM, "Alexander Taylor" notifications@github.com
wrote:

Yeah, the create command only makes an android dist, but this should be
enough to test that pyjnius compiles. You can use the apk command
afterwards to make an apk from this dist.


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

@inclement
Copy link
Member

Mostly they probably don't, most people build apks will be using buildozer which uses the older python-for-android toolchain (with distribute.sh as noted above).

However, this should be identical in the important technical ways to running a new-p4a command like:

p4a apk --requirements=kivy,sdl2 --private /home/asandy/devel/python-for-android/tests/testapp --package=net.inclem.sdl2 --name=sdl2 --version=0.6 --debug

@benson-basis
Copy link
Contributor Author

That commands fails with a problem that isn't accessible to me:

RAN: '/usr/bin/patch -t -d
/home/benson/.local/share/python-for-android/build/other_builds/pyjnius-sdl2/armeabi/pyjnius
-p1 -i
/usr/local/lib/python2.7/dist-packages/pythonforandroid/recipes/pyjnius/sdl2_jnienv_getter.patch'

STDOUT:
patching file jnius/jnius_jvm_android.pxi
patching file setup.py
Hunk #1 FAILED at 41.
1 out of 1 hunk FAILED -- saving rejects to file setup.py.rej

Please fix the android pxi file to be correct as checked in, since I can't
patch your patch.

On Wed, Nov 4, 2015 at 10:51 AM, Alexander Taylor notifications@github.com
wrote:

Mostly they probably don't, most people build apks will be using buildozer
which uses the older python-for-android toolchain (with distribute.sh as
noted above).

However, this should be identical to running a new-p4a command like:

p4a apk --requirements=kivy,sdl2 --private /home/asandy/devel/python-for-android/tests/testapp --package=net.inclem.sdl2 --name=sdl2 --version=0.6 --debug


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

@inclement
Copy link
Member

The patch was broken by the recent changes to pyjnius, I've pushed an updated on to python-for-android master.

Edit: It won't actually work on android until the futures dependency is removed, though.

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.

8 participants