diff --git a/script/determine-jobs.py b/script/determine-jobs.py index a9c7b06360..e4d002975c 100755 --- a/script/determine-jobs.py +++ b/script/determine-jobs.py @@ -662,10 +662,11 @@ def should_run_benchmarks(branch: str | None = None) -> bool: Benchmarks run when any of the following conditions are met: - 1. Core C++ files changed (esphome/core/*) - 2. Top-level Python modules changed (esphome/*.py) — the Python - benchmarks exercise config loading (config.py, yaml_util.py, ...), - so a slowdown there is invisible unless the benchmarks job runs + 1. Core files changed (esphome/core/*, C++ or Python) + 2. Top-level Python files changed (esphome/*.py and esphome/*.pyi) — + the Python benchmarks exercise config loading (config.py, + yaml_util.py, ...), so a slowdown there is invisible unless the + benchmarks job runs 3. The host platform changed (esphome/components/host/*) — benchmarks are built and run on the host platform, so its implementations of ``millis()``/``micros()``/etc. affect every benchmark diff --git a/script/helpers.py b/script/helpers.py index de2f16dbc3..7cc001d92f 100644 --- a/script/helpers.py +++ b/script/helpers.py @@ -1381,17 +1381,17 @@ def core_changed(files: list[str]) -> bool: def base_python_changed(files: list[str]) -> bool: - """Check if any Python module directly in esphome/ has changed. + """Check if any Python file directly in esphome/ has changed. - Matches top-level modules like esphome/config.py and esphome/yaml_util.py - but not files in subdirectories such as esphome/components/ or - esphome/dashboard/. + Matches top-level modules and stubs (.py and .pyi) like esphome/config.py + and esphome/yaml_util.py but not files in subdirectories such as + esphome/components/ or esphome/dashboard/. Args: files: List of file paths to check Returns: - True if any top-level esphome Python module has changed + True if any top-level esphome Python file has changed """ return any( f.startswith("esphome/")