Lines Matching full:version
6 Handle Python version check logic.
9 like during documentation build, a newer version of python could be
16 Python version if present.
35 def __init__(self, version): argument
36 """Ïnitialize self.version tuple from a version string"""
37 self.version = self.parse_version(version)
40 def parse_version(version): argument
41 """Convert a major.minor.patch version into a tuple"""
42 return tuple(int(x) for x in version.split("."))
45 def ver_str(version): argument
46 """Returns a version tuple as major.minor.patch"""
47 return ".".join([str(x) for x in version])
69 """Returns a version tuple as major.minor.patch from self.version"""
70 return self.ver_str(self.version)
75 Get python version from a Python binary. As we need to detect if
85 result = subprocess.run([cmd, "--version"],
90 version = result.stdout.strip()
92 match = re.search(r"(\d+\.\d+\.\d+)", version)
96 print(f"Can't parse version {version}")
102 Detect if are out there any python 3.xy version newer than the
120 version = PythonVersion.get_python_version(cmd)
121 if version >= min_version:
122 python_cmd.append((version, cmd))
131 for Sphinx build. If not, re-run with a newer version if found.
142 print(f"ERROR: Python version {python_ver} is not supported anymore\n")
143 print(" Can't find a new version. This script may fail")
172 # Restart script using the newer version