git-tools icon indicating copy to clipboard operation
git-tools copied to clipboard

Bump minimum Python version to 3.8

Open Repiteo opened this issue 2 years ago • 4 comments

Implements the TODO regarding a python version bump by incorporating a version check outright. Now universal_newlines is only utilized if the version is earlier than 3.7, otherwise text is provided.

Repiteo avatar Dec 11 '23 19:12 Repiteo

Considering Python 3.6 has EOL'd almost 2 years ago (2021-12-23), I think it's safe to be bolder and actually bump the required python version to 3.7 (which is also EOL, but there is no point requiring 3.8).

So if you want to, go ahead and implement text without the version check, and bump python to 3.7 in related docs and install scripts (such as README.md and setup.py)

MestreLion avatar Dec 13 '23 13:12 MestreLion

There doesn't appear to be any setup.py in the repo, and any install script provided downloads the latest Python version anyway, so I'll make the version check in the script itself instead

Repiteo avatar Dec 13 '23 15:12 Repiteo

You know what, let's just make it 3.8 outright. Even if it's not strictly necessary, we're bumping up the version regardless; might as well do so to a version that's actually supported

Repiteo avatar Dec 13 '23 17:12 Repiteo

Sweet!

As this test is performed at the very beginning of the script (as it should), right after the imports, the raise will generate an unhandled exception with a noisy traceback which is not useful in this particular case.

Just change raise ImportError("...") to sys.exit("...") using the same message and we're golden!

MestreLion avatar Dec 14 '23 00:12 MestreLion