Audio Visualizer Python is now working great on Windows 11 and Ubuntu 22.04. Instead of worrying about the creation of packages, I've decided to focus solely on stability, code quality, and documentation. If the project is working, active, and stable then we will surely get pull requests to add convenient packages at some point. 😅
My next goal is adding automated tests to prevent regression of features in the next next goal, which is to improve code quality by refactoring. There are classes in the program which have too many concerns, and several methods that are way too long and procedural. This is because I wrote most of the code 5 years ago. It will be much easier for others to understand the codebase once I've completed these two goals -- but it's a long-term thing.
One section of code I'm not certain about is the Component class that every component inherits from. This class has a metaclass which decorates each method to wrap it with error-checking and automatically call super() and whatnot. This makes creating a new component pretty easy -- you just subclass and define the methods you need -- but metaclasses are quite Python-specific and this decreases maintainability of the code for others. I'm not sold on removing it entirely, however, because it does fulfill its goal of making the actual components simple and providing nice error messages to the user if something goes wrong. If I do refactor that code, it will be a future goal. It's not actually badly-written like the aforementioned huge classes, just a bit unusual.
For this program I decided to make `pytest` a dependency for users even though it is normally a development dependency. The program has a `--test` option at the commandline which runs pytest and generates a text file that users can submit with an issue on GitHub. This is currently a rough idea that isn't fully fleshed out, but it sounds good in theory. The program is very complex, so having a proper crashlog that users know how to access could be really useful, once I write more tests!
#blog #python #qt #avp