mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-01 12:24:15 +00:00
Better error for unsupported Python version (#3398)
Fixes #3371 It seems like uv doesn't proactively enforce 3.8+ and in most cases just issues a warning. This PR keeps that property, only adding the new check when it is known to fail. I checked the imports in this file and the other ones seem fine.
This commit is contained in:
parent
9de49c8a60
commit
95f31f2266
3 changed files with 24 additions and 4 deletions
|
|
@ -22,7 +22,15 @@ def format_full_version(info):
|
|||
|
||||
|
||||
if sys.version_info[0] < 3:
|
||||
print(json.dumps({"result": "error", "kind": "unsupported_python_version"}))
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"result": "error",
|
||||
"kind": "unsupported_python_version",
|
||||
"python_version": format_full_version(sys.version_info),
|
||||
}
|
||||
)
|
||||
)
|
||||
sys.exit(0)
|
||||
|
||||
if hasattr(sys, "implementation"):
|
||||
|
|
@ -435,6 +443,18 @@ def get_operating_system_and_architecture():
|
|||
architecture = version_arch
|
||||
|
||||
if operating_system == "linux":
|
||||
if sys.version_info < (3, 7):
|
||||
print(
|
||||
json.dumps(
|
||||
{
|
||||
"result": "error",
|
||||
"kind": "unsupported_python_version",
|
||||
"python_version": format_full_version(sys.version_info),
|
||||
}
|
||||
)
|
||||
)
|
||||
sys.exit(0)
|
||||
|
||||
# noinspection PyProtectedMember
|
||||
from .packaging._manylinux import _get_glibc_version
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue