|
11 | 11 |
|
12 | 12 | import os |
13 | 13 | import subprocess |
14 | | -from dataclasses import dataclass |
| 14 | +from dataclasses import dataclass, fields |
15 | 15 | from pathlib import Path |
16 | 16 |
|
17 | 17 | TYPE_CHECKING = False |
@@ -56,6 +56,7 @@ class Outputs: |
56 | 56 | run_android: bool = False |
57 | 57 | run_ci_fuzz: bool = False |
58 | 58 | run_docs: bool = False |
| 59 | + run_idle_help_doc: bool = False |
59 | 60 | run_ios: bool = False |
60 | 61 | run_macos: bool = False |
61 | 62 | run_tests: bool = False |
@@ -148,6 +149,7 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs: |
148 | 149 | run_tests = False |
149 | 150 | run_ci_fuzz = False |
150 | 151 | run_docs = False |
| 152 | + run_idle_help_doc = False |
151 | 153 | run_windows_tests = False |
152 | 154 | run_windows_msi = False |
153 | 155 |
|
@@ -201,6 +203,10 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs: |
201 | 203 | if doc_file: |
202 | 204 | run_docs = True |
203 | 205 |
|
| 206 | + # Check for changed IDLE docs |
| 207 | + if file == Path("Doc/library/idle.rst"): |
| 208 | + run_idle_help_doc = True |
| 209 | + |
204 | 210 | # Check for changed MSI installer-related files |
205 | 211 | if file.parts[:2] == ("Tools", "msi"): |
206 | 212 | run_windows_msi = True |
@@ -230,6 +236,7 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs: |
230 | 236 | run_android=run_android, |
231 | 237 | run_ci_fuzz=run_ci_fuzz, |
232 | 238 | run_docs=run_docs, |
| 239 | + run_idle_help_doc=run_idle_help_doc, |
233 | 240 | run_ios=run_ios, |
234 | 241 | run_macos=run_macos, |
235 | 242 | run_tests=run_tests, |
@@ -263,16 +270,10 @@ def write_github_output(outputs: Outputs) -> None: |
263 | 270 | return |
264 | 271 |
|
265 | 272 | with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as f: |
266 | | - f.write(f"run-android={bool_lower(outputs.run_android)}\n") |
267 | | - f.write(f"run-ci-fuzz={bool_lower(outputs.run_ci_fuzz)}\n") |
268 | | - f.write(f"run-docs={bool_lower(outputs.run_docs)}\n") |
269 | | - f.write(f"run-ios={bool_lower(outputs.run_ios)}\n") |
270 | | - f.write(f"run-macos={bool_lower(outputs.run_macos)}\n") |
271 | | - f.write(f"run-tests={bool_lower(outputs.run_tests)}\n") |
272 | | - f.write(f"run-ubuntu={bool_lower(outputs.run_ubuntu)}\n") |
273 | | - f.write(f"run-wasi={bool_lower(outputs.run_wasi)}\n") |
274 | | - f.write(f"run-windows-msi={bool_lower(outputs.run_windows_msi)}\n") |
275 | | - f.write(f"run-windows-tests={bool_lower(outputs.run_windows_tests)}\n") |
| 273 | + for field in fields(outputs): |
| 274 | + name = field.name.replace("_", "-") |
| 275 | + val = bool_lower(getattr(outputs, field.name)) |
| 276 | + f.write(f"{name}={val}\n") |
276 | 277 |
|
277 | 278 |
|
278 | 279 | def bool_lower(value: bool, /) -> str: |
|
0 commit comments