|
50 | 50 |
|
51 | 51 | python etstool.py test-all |
52 | 52 |
|
53 | | -Currently supported runtime values include ``3.6``, and currently |
| 53 | +Currently supported runtime values are ``3.8`` and ``3.11``, and currently |
54 | 54 | supported toolkits are ``null``, ``pyqt5``, ``pyqt6``, ``pyside2``, ``pyside6`` |
55 | 55 | and ``wx``. Not all combinations of toolkits and runtimes will work, but the |
56 | 56 | tasks will fail with a clear error if that is the case. |
|
74 | 74 |
|
75 | 75 | import glob |
76 | 76 | import os |
| 77 | +import platform |
77 | 78 | import subprocess |
78 | 79 | import sys |
79 | 80 | from shutil import rmtree, copy as copyfile |
|
82 | 83 |
|
83 | 84 | import click |
84 | 85 |
|
| 86 | + |
| 87 | +def current_platform(): |
| 88 | + """Return the current platform as a string.""" |
| 89 | + if sys.platform.startswith("win32"): |
| 90 | + return "windows" |
| 91 | + elif sys.platform.startswith("linux"): |
| 92 | + return "linux" |
| 93 | + elif sys.platform.startswith("darwin"): |
| 94 | + if "RELEASE_ARM64" in platform.uname().version: |
| 95 | + return "macos-arm" |
| 96 | + else: |
| 97 | + return "macos" |
| 98 | + else: |
| 99 | + raise click.ClickException(f"Platform {sys.platform} not supported") |
| 100 | + |
| 101 | + |
| 102 | +# Supported toolkits for each runtime. |
85 | 103 | supported_combinations = { |
86 | 104 | "3.8": {"pyside6", "pyqt6"}, |
| 105 | + "3.11": {"pyside6", "pyqt6"}, |
| 106 | +} |
| 107 | + |
| 108 | +# EDS platform strings, keyed by runtime and platform (as returned by current_platform()). |
| 109 | +EDS_PLATFORMS = { |
| 110 | + ("3.8", "linux"): "rh7-x86_64", |
| 111 | + ("3.8", "windows"): "win-x86_64", |
| 112 | + ("3.8", "macos"): "osx-x86_64", |
| 113 | + ("3.11", "linux"): "rh8-x86_64", |
| 114 | + ("3.11", "windows"): "win-x86_64", |
| 115 | + ("3.11", "macos"): "osx-x86_64", |
| 116 | + ("3.11", "macos-arm"): "osx-arm64", |
87 | 117 | } |
88 | 118 |
|
89 | 119 | # Traits version requirement (empty string to mean no specific requirement). |
|
102 | 132 | "packaging", |
103 | 133 | } |
104 | 134 |
|
105 | | -# if on mac, see if we can handle pillow_simd - do we have AVX2? - see #1207 |
106 | | -if sys.platform == "darwin": |
| 135 | +# if on mac/Intel, see if we can handle pillow_simd - do we have AVX2? - see #1207 |
| 136 | +if current_platform() == "macos": |
107 | 137 | result = subprocess.run( |
108 | 138 | ['sysctl', 'machdep.cpu.leaf7_features'], |
109 | 139 | capture_output=True, |
@@ -206,7 +236,7 @@ def install(edm, runtime, toolkit, environment, editable, source): |
206 | 236 |
|
207 | 237 | # edm commands to setup the development environment |
208 | 238 | commands = [ |
209 | | - "edm environments create {environment} --force --version={runtime}", |
| 239 | + "edm environments create {environment} --force --version={runtime} --platform={platform}", |
210 | 240 | "{edm} install -y -e {environment} --add-repository enthought/lgpl --add-repository enthought/gpl " + packages, # noqa: E501 |
211 | 241 | "{edm} run -e {environment} -- pip install -r ci-src-requirements.txt --no-dependencies", # noqa: E501 |
212 | 242 | install_pyface, |
@@ -485,7 +515,7 @@ def get_parameters(edm, runtime, toolkit, environment): |
485 | 515 | if edm is None: |
486 | 516 | edm = locate_edm() |
487 | 517 | parameters["edm"] = edm |
488 | | - |
| 518 | + parameters["platform"] = EDS_PLATFORMS[runtime, current_platform()] |
489 | 519 | return parameters |
490 | 520 |
|
491 | 521 |
|
|
0 commit comments