MestreLion / git-tools

Assorted git tools, including git-restore-mtime
GNU General Public License v3.0
295 stars 74 forks source link

Bump minimum Python version to 3.8 #67

Closed Repiteo closed 2 months ago

Repiteo commented 11 months ago

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.

MestreLion commented 11 months ago

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)

Repiteo commented 11 months ago

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 commented 11 months ago

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

MestreLion commented 11 months ago

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 commented 2 months ago

Thank you, and sorry for taking so long to merge