|
6 | 6 | import glob |
7 | 7 | import os |
8 | 8 | import platform |
9 | | -import re |
10 | 9 | import subprocess |
11 | 10 | import sys |
12 | 11 |
|
@@ -104,19 +103,24 @@ def test_example(self, example): |
104 | 103 | raise AssertionError(f"`{example}` failed ({process.returncode})") |
105 | 104 |
|
106 | 105 | @pytest.mark.skipif(not uv_installed(), reason="uv is required to test PEP 723 metadata installation") |
107 | | - @pytest.mark.skipif(sys.platform == "win32", reason="uv does not currently work on Windows in CI") |
108 | 106 | def test_example_pep723(self, example): |
109 | 107 | system_requirement = SYSTEM_REQUIREMENTS.get(example, lambda: True) |
110 | 108 | if not system_requirement(): |
111 | 109 | pytest.skip(f"Skipping {example} due to unmet system requirement") |
112 | 110 |
|
113 | 111 | example_path = os.path.join(samples_path, example) |
114 | | - process = subprocess.run(["uv", "run", example_path], capture_output=True) # noqa: S603, S607 |
| 112 | + |
| 113 | + # Have uv use the same version of Python that is running the test suite, |
| 114 | + # not because they have to match but to give Python version coverage in CI. |
| 115 | + version_info = sys.version_info |
| 116 | + py_version = f"{version_info.major}.{version_info.minor}" |
| 117 | + |
| 118 | + process = subprocess.run(["uv", "run", "--python", py_version, example_path], capture_output=True) # noqa: S603, S607 |
115 | 119 | if process.returncode != 0: |
116 | 120 | # This example requires a development version of cuda_core, so requirements can't be met. |
117 | 121 | # That's ok, it was tested in the other test, so we just skip it instead of failing. |
118 | | - if re.search("Because only cuda-(core)|(bindings)", process.stderr.decode()): |
119 | | - pytest.skip(f"Skipping {example} due to unmet PEP 723 requirement") |
| 122 | + # if re.search("Because only cuda-(core)|(bindings)", process.stderr.decode()): |
| 123 | + # pytest.skip(f"Skipping {example} due to unmet PEP 723 requirement") |
120 | 124 |
|
121 | 125 | if process.stdout: |
122 | 126 | print(process.stdout.decode()) |
|
0 commit comments