Closed Akuli closed 3 months ago
Why can't platformdirs be removed?
Good question. It can be removed, but it would require a few hours of Windows hell.
Porcupine only uses user_log_path
, user_cache_path
and user_config_path
. Determining them on 3 different platforms gives 9 different cases. It would be slightly more work than this PR, but maybe worth the effort.
As for the windows hell: In platformdirs
source code, they have 3 ways to locate folders (ctypes, registry, environment variables). They dynamically pick whatever works when platformdirs is imported. Environment variables are by far the simplest way, and probably reliable enough for Porcupine, but this needs to be tested in a few different Windows environments to convince me.
There's a reason I've decided to cut windows support in all my future projects lol
Given that xz just happened, I want to minimize Porcupine's dependencies, and I think
toposort
is the only dependency that can be reasonably removed.When I added
toposort
dependency in 2017 (commit c713798b30bad0d3d4812246b07092cb4cfc9c4a), it was because I couldn't figure out how to program it myself. The source code is short, but it looked complicated and I didn't want to copy it. Since then, I have worked with graphs more and the algorithm is now quite obvious to me, so I rewrote it from scratch.