On 10/5/24 02:16, Jeremy Stanley wrote:
On 2024-10-05 01:30:30 +0900 (+0900), Takashi Kajinami wrote: [...]
to distinguish Python < 3.10 from Python >= 3.10 [...]
This is a questionable choice of implementation, given some distros in the past have backported features to older releases or reverted removals they saw as regressions. When possible, it makes more sense to test for the existence/absence of the feature you want to use rather than blindly assuming the (C)Python version will serve as a faithful proxy. An up-side to this approach is that you don't need to worry as much about version boundaries, as long as you test versions both with and without the feature/behavior in question.
The super annoying thing with that change is that importlib.metadata.entry_point has been existing since python 3.8 but it changed the behavior in python 3.10 . So checking existance of modules/attributes didn't work and I avoided implementing hanky inspect check to analyze accepted arguments. An alternative solution may be relying on importlib_metadata for all versions because it works for Python 3.12, but I was unsure if requiring unnecessary 3rd party dependency to make the code older version would be a good choice.