[chirp_devel] Future patches for python 3?

Jake Merdich
Sat Nov 10 14:00:00 PST 2018


So, I've always loved chirp, and this weekend I wanted to contribute
patches to make my radios more feature-rich, but when I looked at the
mailing list to see what's needed, the python 3 issue seemed most dire
(since I use fedora and they may drop the package over this :P).

As far as I can tell, here's the state of the code base with regards
to python 3:

===== Fundamental issues =====
PyGtk (unmaintained) only supports python 2
 - PyGObject looks good, easy to migrate, but only supports GTK+3.x.
There might be a visual difference from GTK+2.x
 - There's a compatability shim, but it is far from perfect

Py2exe (unmaintained) only supports python <=3.5
 - Use old python on windows, patch it, or use an alternative?

Windows XP only supports python <=3.4 (per docs)
 - Also only supports up to GTX+3.17 (~2015, unsupported)

===== Python 3 Syntax Issue Count =====
Ambiguous int vs. float division syntax: 599
Old exception syntax: 240
Print statements: 124
Misc iterator changes: 91
Misc dict changes: 89
Usage of builtin functions changed: 60
Other things: ???

I'm a programmer by day and I'd be more than willing to put in the
effort for these issues, having done other hefty py3 migrations
before.

Thing is that the changes that need to be made are neither small nor
self-contained, so I'd like to at least give a heads up to the current
maintainers (hi Dan!) and make sure work isn't duplicated if anyone is
working on this already.

Any particular comments about things they do/don't want to see would
be great too. My current plan is:
 1. Work on the GObject problem first. If desired, I can keep the
original PyGtk code working in parallel, but I think that will cause
confusion in the long run. Be prepared for one monolithic patchset.
Still python 2 code.
 2. Work out any hidden issues that GObject has, ensure packaging
works, etc. I hope there will be nothing here that isn't caught by
review but experience has taught me otherwise...
 3. Add disabled-by-default python 3 testing.
 4. Fix things until tests work under python 3
 5. Enable testing on python 3 by default (in addition to testing on python 2)
 6. Test python 3 builds on my radios and share it with tech-literate
hams I know to find any bugs not caught in tests
 7. Eventually, python 2 will be dead and gone, and this can become the default.

Feedback welcome! I've been lurking on IRC if anyone wants to discuss as well.

Jake Merdich
W7MEH



More information about the chirp_devel mailing list