mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Check maximum Python version in mach (#34490)
Mach is currently failing bootstrap and building if the Python version is greater than 3.12. This is because wpt does not support 3.13 yet. This causes confusion for people running recent distros that ship 3.13 by default. I changed the logic so that mach checks both the minimum and the maximum supported versions of Python instead of just checking the minimum. It will now also tell you which maximum version is supported. I also updated the README.md to specify the supported Python versions so that people don't accidentally install the wrong version. Signed-off-by: Michael Mc Donnell <michael@mcdonnell.dk>
This commit is contained in:
parent
5201c84fb4
commit
3fa1d3d9cf
2 changed files with 10 additions and 6 deletions
10
mach
10
mach
|
@ -12,11 +12,15 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
if sys.version_info < (3, 10):
|
||||
print("mach does not support python < 3.10, please install python 3 >= 3.10")
|
||||
# Destructure because version_info > max_ver is true when running the same version.
|
||||
ver = (sys.version_info[0], sys.version_info[1])
|
||||
min_ver = (3, 10)
|
||||
max_ver = (3, 12) # WPT does not support Python 3.13. See issue #34095.
|
||||
if ver < min_ver or ver > max_ver:
|
||||
print("mach does not support python {0}.{1}, please install 3.{2} <= python <= 3.{3}" \
|
||||
.format(ver[0], ver[1], min_ver[1], max_ver[1]))
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def main(args):
|
||||
topdir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
||||
sys.path.insert(0, os.path.join(topdir, "python"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue