Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated dependency tool to allow python versions 3.10-3.13 #913

Merged
merged 3 commits into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 9 additions & 14 deletions helpers/dependency_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,29 @@ def test_cmd(command):
process.kill()
return result, 'Not found.'


def check_python():
result, error = test_cmd('python -V')
# if python_error is not None or python_error != b'':
# print('\t- Python:', 'ERROR:', python_error)
# return
if result is None:
print('\t- Python:', 'ERROR: Unknown return')
return

version = None
regex = r"Python (?P<version>[0-9\.]+)"
matches = re.finditer(
regex, result, re.MULTILINE)
regex = r"Python (?P<major>[0-9]+)\.(?P<minor>[0-9]+)"
matches = re.finditer(regex, result, re.MULTILINE)
for _, match in enumerate(matches, start=1):
version = match.group('version')
version = packaging.version.Version(f"{match.group('major')}.{match.group('minor')}")

if version is None:
print('\t- Python:', 'ERROR: Unable to get version')
return

version = packaging.version.Version(version)
repo_version = packaging.version.Version("3.13")
if version.major is not repo_version.major:
print('\t- Python:', 'WARNING: wrong major version')
return
# Define acceptable versions, only considering major and minor
acceptable_versions = {packaging.version.Version('3.10'), packaging.version.Version('3.11'),
packaging.version.Version('3.12'), packaging.version.Version('3.13')}

if version.minor is not repo_version.minor:
print('\t- Python:', 'WARNING: wrong minor version')
if version not in acceptable_versions:
print('\t- Python:', 'WARNING: version not in supported range (3.10-3.13)')
return

print('\t- Python:', 'OK')
Expand Down
Loading