tests: check min required python version with vermin (#14289)

This commit removes the `python_version.py` unit test module
and the vendored dependencies `pyqver2.py` and `pyqver3.py`.
It substitutes them with an equivalent check done using
`vermin` that is run as a separate workflow via Github Actions.

This allows us to delete 2 vendored dependencies that are unmaintained
and substitutes them with a maintained tool.

Also, updates the list of vendored dependencies.
This commit is contained in:
Massimiliano Culpo
2019-12-24 18:28:33 +01:00
committed by Todd Gamblin
parent 1e2c9d960c
commit d333e14721
13 changed files with 42 additions and 769 deletions

View File

@@ -8,7 +8,7 @@
import warnings
try:
from collections.abc import Sequence
from collections.abc import Sequence # novm
except ImportError:
from collections import Sequence

View File

@@ -6,7 +6,7 @@
import os.path
try:
from collections.abc import MutableMapping
from collections.abc import MutableMapping # novm
except ImportError:
from collections import MutableMapping

View File

@@ -612,12 +612,14 @@ def load_module_from_file(module_name, module_path):
"""
if sys.version_info[0] == 3 and sys.version_info[1] >= 5:
import importlib.util
spec = importlib.util.spec_from_file_location(module_name, module_path)
module = importlib.util.module_from_spec(spec)
spec = importlib.util.spec_from_file_location( # novm
module_name, module_path)
module = importlib.util.module_from_spec(spec) # novm
spec.loader.exec_module(module)
elif sys.version_info[0] == 3 and sys.version_info[1] < 5:
import importlib.machinery
loader = importlib.machinery.SourceFileLoader(module_name, module_path)
loader = importlib.machinery.SourceFileLoader( # novm
module_name, module_path)
module = loader.load_module()
elif sys.version_info[0] == 2:
import imp