kivy / kivy-ios

Toolchain for compiling Python / Kivy / other libraries for iOS
https://kivy.org/docs/guide/packaging-ios.html
MIT License
781 stars 240 forks source link

Python 3 support #184

Closed Allactaga closed 5 years ago

Allactaga commented 8 years ago

Hi,

I was trying to evaluate the time when kivy's python 3 support for iOS would be released, regarding the FAQ quote "Be patient. We’re working on it". However only evidence I found of such work is this issue which is kind of contradicts with whole story.

Could you please briefly explain what work needs to be done for python 3 support to happen? What experience with codebase needed for all of this (can outsiders help)? May be create few issues and tag them with py3.

Thank you.

Sincerely, Eugene

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/32853883-python-3-support?utm_campaign=plugin&utm_content=tracker%2F9081&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F9081&utm_medium=issues&utm_source=github).
admincoder commented 8 years ago

Kivy-iOS is the only toolchain NOT supporting python 3, which is stopping Kivy from being a python 3 complete framework. I am new to Kivy, as well as Github but immediately fell in love with Kivy and the way it organizes it's sister projects with such modularity. From what I have seen Kivy has had slow release cycles, which is acceptable but only if the entire project benefits from a major release or rather have shorter release cycles that update bits of the framework at a time.

As a new mobile developer, I am ecstatic to use something like Kivy and take advantage of Python and it's ecosystem for cross platform development. But I noticed that in the mobile space, Android & Pyjnius are given way more attention than iOS & Pyobjus. This is very bad as the majority of the developer community worldwide prefers to release apps for iOS first before Android; better from a business point of view. Whether this is because of a lack of interest in iOS or a lack of devices to test, the issues must be made clearer and the core Kivy developers must ask for specific community help if needed.

Conclusion: @tito, @akshayaurora, @Kovak, @tshirtman, @dessant, @kived, @inclement, @Zen-CODE, and others. Far more attention should be paid to iOS as a whole: Kivy-iOS [Python 3], Pyobjus, Plyer (iOS) and updated/more Kivy-iOS recipes. If for whatever reason (eg. No interest, No devices, etc.), Kivy core developers have trouble, they should explicitly list the kind of help wanted from the community.

I think it would be a good idea if people pledged their willingness to help.@Allactaga

+1 to help Kivy-iOS

admincoder commented 8 years ago

+1 to help Kivy-iOS.

haricot commented 8 years ago

Maybe we can try to complie it with the patch on web site python issue : Modifications to support iOS as a cross-compilation target https://bugs.python.org/issue23670 patch : 20160217.diff

I don't have osx and xcode for tested but in adapting recipes for hostpython3 and python3 maybe this may give some thing. Hoping python2 python3 for ios and not too different.

Zen-CODE commented 8 years ago

@admincoder

I feel you. I think the cost of hardware is certainly one factor in the Android vs. iOS popularity. For Android, you have a full dev + test environment on a cheap PC with a free OS. For iOS, you have to have a mac and an Apple dev license. It's a significant barrier.

Anyway, Python 3. I'm currently a noob to Mac/iOS and still trying to understand how it all works. Stability and a few feature additions in Python 2 are my current priority (and already at the limit of my knowledge), but I plan to give Py3 some love after that.

Can't really comment on the effort going into Py3 otherwise: I tend to to work more in isolation. The irc channel may be a good place to get dev feedback...

aakashc92 commented 8 years ago

@Zen-CODE, @tito, @haricot

Check out, https://github.com/pybee/Python-iOS-support. It has patches and pre-built versions of python 2.7, 3.4 & 3.5(master) for iOS, WatchOS & TvOS.

Do you think these patches/frameworks can be integrated into Kivy?

inclement commented 8 years ago

I'm fairly sure that kivy-ios could use these versions of python without much trouble, but the reason kivy-ios doesn't support it yet is mostly that we haven't had anyone both with Apple devices and able to commit developer time to it. If anyone would like to work on a PR for this themselves, that would be welcome, and we're happy to help with any questions or problems.

orling commented 8 years ago

I have all the necessary hardware and a few days to spare, but I'm not sure how to proceed. Can somebody give me some guidance?

I saw that in kivy-ios/dist/hostpython there are Python2's header files, an executable 2.7 binary and a libpython2.7.a static library. From this link: https://github.com/pybee/Python-Apple-support I downloaded a pre-compiled Python 3 for iOS, but it only contains the headers and executable, not the static library. Besides, will kivy-ios's Xcode project be able to link properly with Python 3's libs and headers?

Would the toolchain.py need to be modified somehow? What about the Xcode project template?

Simply using Python 2 is not an option for me, as I need to port a large existing Python 3 codebase for mobile, and Kivy is practically the only Python-based framework.

inclement commented 8 years ago

I'm not a kivy-ios expert, but the basic structure is the recipe system, which compiles python (and other dependencies) from source. This requires two python builds; a hostpython compiled for the current architecture, and a targetpython (named just python in the recipes) which is the arm build. For python3, you'd need to replace both of these with python3 alternatives.

One intermediate option would be to try to add a python3 recipe that downloads a precompiled version from elsewhere, although (as you note) you'd need the static library as well, and you'd need to check through the kivy-ios code to find where the libraries should be placed.

The ideal final option, which hopefully should be easy if python compiles easily on ios nowadays, is to add a hostpython3 recipe (building python3 for the local machine) and python3 recipe (building for the ios device) which both perform the full compilation process. For this you'd need to read and understand the existing recipes, but most of what they do should translate directly, and python3 should (unlike python2) not need the patches. For this you can also look at the pybee build tools, as they must have something to compile python before the binary distribution stage.

orling commented 8 years ago

I'm sorry but I couldn't implement it and I no longer work for this company, or with Kivy, so somebody else will have to do it

YasserAntonio commented 8 years ago

Is there someone on It ? I want to help even if i only have a basic knowledge with python 3 programming.

auvipy commented 7 years ago

I want to help porting it to python3. whats where should I start? @Zen-CODE

Zen-CODE commented 7 years ago

So many places. Where to start? I think join us on the kivy-dev irc channel and ask there?

Kivy-dev on irc.freenode.net

auvipy commented 7 years ago

OK

Zen-CODE commented 7 years ago

@auvpy @YasserAntonio .

Have a look here: https://github.com/kivy/python-for-android/issues Choose an issue and tuck in. [Updated] Sorry, that is more for android I guess...

Beyond that, the core thing needed is a recipe for hostpython3 and for python3. Try getting that going?

jatty commented 6 years ago

Have a look at BeeWare with "PyBee" - they have developed iOS/Xcode binary support for Pytho n2.7 and Python 3.4/3.5/3.6/3.7. Perhaps, Kivy project could be merged with BeeWare's developements with BeeWare framework for the basic layers connecting to Android and iOS, and Kivy on top of this, providing the GUI/MVP layer. Just my $0.02.

https://github.com/pybee/Python-Apple-support

hackalog commented 6 years ago

Just checking in. Is anyone currently looking at Python3 support for either Kivy-IOS or PyObjus? Is anyone here planning on it?

misl6 commented 6 years ago

@hackalog I expect to dig into this in the next few weeks.

hackalog commented 5 years ago

@misl6 Still interested?

magic-lantern commented 5 years ago

Any update since January on Python 3 iOS support?

With Python 2.7 support slated to end in about 7 months, getting Python 3 support seems more urgent.

misl6 commented 5 years ago

@magic-lantern kivy-ios now supports python3.

smlbiobot commented 5 years ago

@misl6 Thanks for this — maybe someone should update the docs here as Kivy not supporting Python3 is a warning on the page: https://kivy.org/doc/stable/guide/packaging-ios.html

modena01 commented 4 years ago

The doc still has the warning at the top that python3 is not supported. Having just wasted a bunch of time trying to get it working with python2, can we confirm that kivy-ios supports python3?

Many thanks.

magic-lantern commented 4 years ago

@modena01 - see @misl6 comment from May 29, 2019. Python 3 works, just the documentation needs to be updated to match.

Zen-CODE commented 4 years ago

And the documentation has been updated accordingly: https://github.com/kivy/kivy/blob/master/doc/sources/guide/packaging-ios.rst#create-a-package-for-ios

modena01 commented 4 years ago

thanks for that, I was looking here, which says python3 is still WIP

https://kivy.org/doc/stable/guide/packaging-ios.html