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

WIP: Python3 Support #60

Merged
merged 31 commits into from
Aug 11, 2019
Merged

WIP: Python3 Support #60

merged 31 commits into from
Aug 11, 2019

Conversation

mkg20001
Copy link
Collaborator

@mkg20001 mkg20001 commented Mar 17, 2019

ToDos:

@mkg20001
Copy link
Collaborator Author

Compiling '/home/data/.buildozer/android/app/zero/plugins/Zeroname/updater/zeroname_updater.py'...
***   File "/home/data/.buildozer/android/app/zero/plugins/Zeroname/updater/zeroname_updater.py", line 13
    print "* Signing and Publishing..."
                                      ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("* Signing and Publishing...")?

@mkg20001
Copy link
Collaborator Author

mkg20001 commented Mar 23, 2019

@shortcutme The zeroname plugin needs to be converted to py3, after that I can release a beta of zn-kivy for py3

@mkg20001
Copy link
Collaborator Author

03-24 08:28:17.757 20460 20479 I zn      : [ERROR  ] [Unhandled exception] The 'greenlet>=0.4.14' distribution was not found and is required by the application

Added greenlet, it still complains

@mkg20001
Copy link
Collaborator Author

mkg20001 commented Jun 9, 2019

06-09 21:11:09.479 29301 29315 I zn      : - Starting ZeroNet...
06-09 21:11:09.484 29301 29315 I zn      : [ERROR  ] [Unhandled exception] No module named 'main'
06-09 21:11:09.484 29301 29315 I zn      : Traceback (most recent call last):
06-09 21:11:09.484 29301 29315 I zn      :   File "/home/data/.buildozer/android/app/zero/zeronet.py", line 18, in main
06-09 21:11:09.484 29301 29315 I zn      : ModuleNotFoundError: No module named 'main'
06-09 21:11:09.990 29301 29315 I zn      :  Traceback (most recent call last):
06-09 21:11:09.992 29301 29315 I zn      :    File "/home/data/.buildozer/android/app/zero/zeronet.py", line 18, in main
06-09 21:11:09.993 29301 29315 I zn      :  ModuleNotFoundError: No module named 'main'
06-09 21:11:09.994 29301 29315 I zn      :  
06-09 21:11:09.994 29301 29315 I zn      :  During handling of the above exception, another exception occurred:
06-09 21:11:09.995 29301 29315 I zn      :  
06-09 21:11:09.995 29301 29315 I zn      :  Traceback (most recent call last):
06-09 21:11:09.996 29301 29315 I zn      :    File "/home/data/.buildozer/android/app/platform_android.py", line 53, in wrapSentry
06-09 21:11:09.997 29301 29315 I zn      :    File "/home/data/.buildozer/android/app/service.py", line 61, in main
06-09 21:11:09.997 29301 29315 I zn      :    File "/home/data/.buildozer/android/app/zero/zeronet.py", line 28, in main
06-09 21:11:09.998 29301 29315 I zn      :  ModuleNotFoundError: No module named 'Config'
06-09 21:11:10.086 29301 29315 I python  : Python for android ended.
06-09 21:11:10.164 29089 29090 I adbd    : initializing functionfs

Now I'm stuck here

@HelloZeroNet
Copy link
Owner

HelloZeroNet commented Jun 11, 2019

There was a change recently and the main() entry point modified to start() (to be able to have update entry point beside the main), so I think you need to change zeronet.main() to zeronet.start() here:

zeronet.main()

@mkg20001
Copy link
Collaborator Author

mkg20001 commented Jun 14, 2019

@HelloZeroNet Applied it, but I think it will still fail because of the issue of not being able to find greenlet
It does install it via a custom recipe script and not via the standard way using pip, so some metadata seems to be missing and it can't load it
On the other hand when forcing a version it does install correctly via pip, but uses a precompiled greenlet which isn't compiled for arm

Any idea how to fix that? That would be (presumably) on of the last bugs to fix before I could do a release, or at least move py3 to master.

Edit: If you've got the time, you could jump through the different nightlies for ZeroNetN3 on F-Droid and see if you can make any sense of those errors. If you need help ripping apart the APK - it's partly non-standard what python-kivy does - to get the files, just ping me

@mkg20001 mkg20001 self-assigned this Jun 14, 2019
@mkg20001
Copy link
Collaborator Author

This is where I'm stuck currently:

assets/_python_bundle/site-packages/greenlet-0.4.15.dist-info/ is missing in python-for-android recipe build
Without using recipe (using specific parameter), it fails to compile for the correct architecture. (This could either be missing cross-compile support in setup.py, or because it uses a wheel)

CompiledComponentsRecipe, which it currently is using, fails to generate that dist-info
Recipe recipe seems to do the same
Would have to try with CpythonRecipe, although I should test if it uses right py4a first

Really this is ANNOYING! Since this bit of files is what's missing until it FINALLY works!

@mkg20001
Copy link
Collaborator Author

/me throws out a 10$ bounty for who-ever manges to get this dependency/recipe issue resolved

#63

@saber28
Copy link

saber28 commented Jul 10, 2019

Hi, time flies! Two years passed and now we are working on py3 version on android. Thank you again for dev the new APK! I noticed you are facing problem of greenlet on kivy, I suggest putting greenlet before gevent in buildozer.spec#L44, because the order counts and greenlet is required by gevent. I am not sure it will solve the problem but anyway you could try it. After putting them in right order you can try downgrade greenlet or gevent again if it still doesn't work.

@mkg20001
Copy link
Collaborator Author

@saber28 Thanks, will try later this week

@mkg20001
Copy link
Collaborator Author

@saber28 Sadly this didn't fix it

@mkg20001
Copy link
Collaborator Author

Ok, this is taking forever
Merging this into master, since py3 is now default

@mkg20001 mkg20001 merged commit b07ca66 into master Aug 11, 2019
@mkg20001 mkg20001 deleted the py3 branch August 11, 2019 16:31
@mkg20001
Copy link
Collaborator Author

mkg20001 commented Aug 11, 2019

For everyone watching this pr: feel free to chime in on https://t.me/zeronet_android while testing

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.

None yet

3 participants