Adding Python 3 support
Name: Rohit Kumar
forum/e-mail: rohit-rk / [email protected]
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.
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.
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.
- 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.
Python(both 2 and 3), C++ , Swig , Groovy, understanding of kodi code base including how addons are used and loaded.
Please suggest any changes to make this proposal better.