Python 3 Update Complete! (Patreon)
Content
The recent release of Ren'py 8 moved from Python 2.7 (which has been depreciated since 2020!) to Python 3. I decided it was a good idea to get this shift done sooner rather than later and have spent the last couple of days sorting out minor issues. I'm happy to say the transition has been mostly painless and I'm able to get back to work on the Live2D rendering system now. If you're interested in programming details, read on!
In an ironic twist of fate, the first thing to break in Ren'py 8 was my testing framework! Renpy ships with a trimmed down version of Python which doesn't include the unittest module. The old Python 2.7 unittest module I manually include ran into some deep compatibility errors, preventing the whole thing from working. This was a trivial fix once I figured out what was actually happening: I just had to manually include the Python 3 unittest module and LR2 was up and running!
At this point all the time writing unit tests paid off. I was able to quickly identify a whole swath of errors. First, a couple of modules were renamed going to Python 3 and needed to have their import lines changed. Second, the way keys for dictionaries are handled had changed, resulting in crashes anywhere those were searched through. Finally, Python 3 imposes stricter comparison function requirements, so many classes needed some new (but relatively simple) code written for that.
I've been able to run through the basics of my integration tests as well and crunch some minor file read/write bugs. Unfortunately the Clothing/Outfit code is still a work in progress and that comes up a lot any time characters are being talked to. Once that code is finished I'll do a final sweep through all my tests and I can be reasonably confident nothing is broken (or that it's broken in new and exciting ways I haven't seen before!).
I'll be back with an update on the clothing code once I have something interesting about it to share!