Files
Nicola Soranzo b86e88720c Drop support for Python 3.10
Python 3.10 reached its end-of-life in October 2026.

Also:
- Run `make pyupgrade` and `make format`
- Fix new ruff and mypy errors
- Run `uv lock` and `sh lib/galaxy/dependencies/update.sh --export-only`
- Run `make update-client-api-schema`
2026-11-17 21:57:50 +00:00

38 lines
1.1 KiB
Python

"""
If the current installed Python version is not supported, prints an error
message to stderr and returns 1
"""
from __future__ import print_function # noqa: UP010
import sys
MIN_VERSION_TUPLE = (3, 11)
def check_python():
if sys.version_info[:2] >= MIN_VERSION_TUPLE:
# supported
return
else:
version_string = ".".join(str(_) for _ in sys.version_info[:3])
min_version_string = ".".join(str(_) for _ in MIN_VERSION_TUPLE)
msg = """ERROR: Your Python version is: {}
Galaxy is currently supported on Python >={} .
To run Galaxy, please install a supported Python version.
If a supported version is already installed but is not your default,
https://docs.galaxyproject.org/en/latest/admin/python.html contains instructions
on how to force Galaxy to use a different version.""".format( # noqa: UP032
version_string,
min_version_string,
)
print(msg, file=sys.stderr)
raise Exception(msg)
if __name__ == "__main__":
try:
check_python()
except Exception:
sys.exit(1)