zynthian / zynthian-issue-tracking

Centralized Issue Tracking for Zynthian Project
https://github.com/orgs/zynthian/projects/1
11 stars 3 forks source link

Migrate from Python 2 #17

Closed riban-bw closed 3 months ago

riban-bw commented 5 years ago

Python 2 is scheduled to be out-of-support on 1st January 2020. There are some zynthian modules (or upstream dependencies) that use Python 2. We should ensure we are migrated from Python 2 before it becomes unsupported.

A quick grep for /usr/bin/python2 gives:

/zynthian/zynthian-sys/scripts/recipes/install_lv2_lilv.sh:#./waf configure --bindings --python=/usr/bin/python2 /zynthian/zynthian-ui/sys-scripts/recipes/install_lv2_lilv.sh:#./waf configure --bindings --python=/usr/bin/python2 /zynthian/zynthian-ui/software/lilv_python_examples/lv2ls.py:#!/usr/bin/python2 /zynthian/zynthian-ui/software/lilv_python_examples/lv2info.py.bak:#!/usr/bin/python2 /zynthian/zynthian-ui/software/lilv_python_examples/lv2ls.py.bak:#!/usr/bin/python2 /zynthian/zynthian-ui/software/lilv_python_examples/lv2info.py:#!/usr/bin/python2 /zynthian/zynthian-ui/software/mod-host/tests/test_host.py:#!/usr/bin/python2 /zynthian/zynthian-sw/lilv_python_examples/lv2ls.py:#!/usr/bin/python2 /zynthian/zynthian-sw/lilv_python_examples/lv2info.py.bak:#!/usr/bin/python2 /zynthian/zynthian-sw/lilv_python_examples/lv2ls.py.bak:#!/usr/bin/python2 /zynthian/zynthian-sw/lilv_python_examples/lv2info.py:#!/usr/bin/python2 /zynthian/zynthian-sw/mod-host/tests/test_host.py:#!/usr/bin/python2 /zynthian/build/zynthian-sys/scripts/recipes/install_lv2_lilv.sh:#./waf configure --bindings --python=/usr/bin/python2

jofemodo commented 5 years ago

Nothing to do here. Zynthian code use python3 only and there is no dependencies with python2 modules. All the strings containing "python2" are unused tests and examples. Anyway, i will check that there is no hidden/unknown/bizarre dependencies.

riban-bw commented 5 years ago

I guess the acid test is to remove Python 2 from the system.

jofemodo commented 5 years ago

This will be for the next SD image release ... ;-)

riban-bw commented 5 years ago

Ah! Sounds like a promise for a new SD image before the end of the year :-)

wyleu commented 5 years ago

Bye, bye print . . . .

sniff.

riban-bw commented 5 years ago

We should start listing modules that depend on Python 2.

riban-bw commented 4 years ago

The end of year (and end of life for Python 2) is fast approaching. I really think we should pay some attention to this issue. I suggest uninstalling Python 2 and seeing what stops working. Maybe there could be a Jenkins job configured to test this? Once we know what is affected we can then put some comms around what becomes (partially) unsupported at the end of the year, e.g. touchosc2midi may have reduced support due to use of legacy platform. We can also add tickets to upstream projects to encourage them to migrate. I want to be sure we don't find ourselves in trouble due to a Python 2 bug or vulnerability being triggered after support is withdrawn.

riban-bw commented 4 years ago

Well, having started warning seven months ago then getting a little more concerned a month ago we are now just days away from loss of support for Python 2. Someone should uninstall it and see what breaks! Maybe a little task for the Yuletide? My Zynthian is being refactored so I can't look at this until after Christmas and I will need some time to test the unit works as expected before I start to cut limbs off it. Maybe someone with several Zynthians and experience with Python may feel like tackling this. Not pointing any fingers but @wyleu looks like a contender 😋.

wyleu commented 4 years ago

Well ok just to start things off . . .

image

Seems to boot ok after that act of larceny . . .

wyleu commented 4 years ago

And now renaming the instance of python2.7 . . .

I'll run it like this and see if any problems emerge . . .:-D

image

wyleu commented 4 years ago

Machine crashes when it gets a All Sounds off, message locally & across qmidinet . . .

image

wyleu commented 4 years ago

./zynthian.sh: line 132 534 Segmentation fault ./zynthian_gui.py

i don't know if this is general but none of the other machines go down but they all seem to be able to knock this machine down. Machine reboots cleanly eventually. . .

jofemodo commented 4 years ago

It's strange, but i don't see any relation with Python 2.7 ... All zynthian UI & webconf software use Python 3 from the first day. I never used Python 2.7. MOD-UI also uses python 3.

Anyway, i'm not concerned at all with this subject. It's good to check and see if we have some hidden dependency, but not having support doesn't mean python 2.7 won't be available in Buster.

Perhaps next Debian version removes 2.7 completely, and then, any hidden dependency will be solved. Of course, the sooner we have this information, the better!

wyleu commented 4 years ago

I don't know if it's python2.7 related. I'll back off the python2.7 restriction I.e. add bits of Python2.7 back in and see if it fixes anything...

jofemodo commented 3 years ago

Currently, the only Python2 dependency i know is touchosc:

https://github.com/velolala/touchosc2midi

But the author doesn't seem interested on porting to Python3, so if we want to keep using this feature, we must do the work ourselves. BTW, it doesn't seem too complex to do, so perhaps we could find a volunteer ... ;-)

Regards,