GSoC'17 Proposal :- Adding Python 3 support

  Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
rohit-rk Offline
Junior Member
Posts: 14
Joined: Mar 2017
Reputation: 0
Post: #16
Agreed, this pain will have to be taken sooner or later. Having options for both will be good.
(2017-03-17 19:46)da-anda Wrote:  v2 and v3 IMO should run in parallel for at least 1 Kodi version to ease transition
find quote
rohit-rk Offline
Junior Member
Posts: 14
Joined: Mar 2017
Reputation: 0
Post: #17
GSoC'17 Project proposal:
Adding Python 3 support

Name: Rohit Kumar
forum/e-mail: rohit-rk / [email protected]

Introduction:
When did you first start programming?
I started programming four years ago learning MySQL and Java (graphics) for first two years, then after joining college i started coding in C(Worked on Data structures and algorithms implementation). I am in my 2nd year of B.Tech at Dr. B. R. Ambedkar National Institute of Technology Jalandhar majoring in computer science. In 2016, I picked C++ (as academic course) and started Python on my own. Also done a course in Mongodb with python(bottle, pymongo).

Are you a user of Kodi? When did you first start using it? :
Yes, but still newbie started from this january only.I use kodi for Soundcloud, youtube, Udacity, etc.

Have you contributed to other Open Source projects? If so, which projects and can we see some of your code?
As i am new to open source, there is not much to show but i made a pull request and fixed a bug in jx-sqlite.

If you have not contributed to open source projects, do you have other code we can look at? :

My github handle is rohit-rk, and i am creating my website in my free time at akarohit.me .Also thinking to blog my work as I do to keep myself motivated.Many of my projects are on github https://github.com/rohit-rk .

Tell us about the computer and devices you have available for working on your SoC project? :
I have Ideapad Y700(6th gen i7 processor with windows 10 and ubuntu installed), Dell Vostro 1540(i3 processor with windows) and an android phone during SoC.

How much time do you have available, and how would you plan to use it?

I will be having approx. 12 weeks, will divide my work into sub parts as written in Goals. Will learn all about the codebase and other dependencies in community bonding period.

Do you plan to have a job or study during the summer in conjunction with Summer of Code?

My plan is (and I have spent time making sure this is possible) to be able to devote as much time as possible to GsoC in summer. No academic obligations throughout the whole coding period.

Summary:
We have two version of python language that are currently in development: Python 2.x(2.7) which retains backwards compatibility with previous versions and Python 3.x which breaks this compatibility. Kodi does not support Python 3.x at this point. EOL for Python 2.7 is postponed many times, but it is likely to come soon. So, it is important to atleast have compatibility for both, if not porting to Python 3 completely.

How will I achieve this:
Kodi’s python code base is not hand coded, rather generated as a part of building kodi. Code builder is Swig plus Groovy logic. Swig is responsible for parsing c++ header files. Present bindings are for python 2. For supporting python 3, I need to work on generating bindings in Swig for python 3 and adding python3 interpreter an option to let addon developers choose between python 2 and 3(this may make the project too big for summer, i am not sure.). Addition of requires tag defining the python version, xml file will then load that particular version.


What will the project focus on:
The project focuses on supporting python 3 without losing compatibility with python 2. Important parts are : Swig binding implementation, Addon’s xml part, also working on c++ files for new changes made in python.h for python 3.

Benefits:
Having support for both python versions will give addon developers enough time to properly switch to python 3. Addons supporting both versions of python, at later stages will make complete switching to Python 3 easily possible.

Goals:
  • Modify C++ files for new changes made in python.h for python 3.
  • Generating bindings in Swig for python 3.
  • Addition of a new tag for addon .xml (not sure of this).
  • Making it possible to run an addon with all this new setup.
  • Updating addons to python 3.

Also making sure that everything still works in python2.

What does it touch in Kodi:
  • SWIG implementation.
  • Python Integration.
  • Python API implementation
  • Addons Develpoment.


Requirements:
Python(both 2 and 3), C++ , Swig , Groovy, understanding of kodi code base including how addons are used and loaded.

Mentors:
Thanks

Please suggest any changes to make this proposal better.
(This post was last modified: 2017-03-26 21:32 by rohit-rk.)
find quote
rohit-rk Offline
Junior Member
Posts: 14
Joined: Mar 2017
Reputation: 0
Post: #18
Can i write two proposals for same project , if there are two different approach.
find quote
rohit-rk Offline
Junior Member
Posts: 14
Joined: Mar 2017
Reputation: 0
Post: #19
should i create a new thread for proposal, got no review on this one.
find quote
Razze Offline
Team-Kodi Member
Posts: 1,582
Joined: Jan 2015
Reputation: 50
Location: Osnabrück, Germany
Post: #20
(2017-03-22 14:17)rohit-rk Wrote:  Benefits:
There are two categories of python developers. Users of python 2 and python 3, and working with Kodi they are restricted to using python 2 for now. Having support for both will make it possible for developers to work in there preferred language. Addon will be made in both languages. This will bring more developers to Kodi. Users need not worry about inderlying interpreter they are using.

Just to be clear, the long term goal will be to deprecate python2, but we will want to have at least one major version of kodi that supports both to give every addon developer enough time to properly switch to python3

Otherwise your proposal looks solid to me. Good work.
find quote
rohit-rk Offline
Junior Member
Posts: 14
Joined: Mar 2017
Reputation: 0
Post: #21
Thanks for review, post updated.
(This post was last modified: 2017-04-01 22:56 by rohit-rk.)
find quote
Post Reply