mirror of
https://github.com/esphome/esphome.git
synced 2026-10-16 19:22:49 +00:00
Merge branch 'store-yaml-helpers-core' into store-yaml-firmware
This commit is contained in:
+2
-11
@@ -1065,15 +1065,13 @@ HEAP_ALLOCATING_HELPERS = {
|
||||
r"str_sprintf|"
|
||||
r"str_snprintf|"
|
||||
r"value_accuracy_to_string"
|
||||
r")\s*\(" + CPP_RE_EOL,
|
||||
# Explicit template arguments at any nesting depth, e.g. format_hex<std::array<uint8_t, 4>>(
|
||||
r")\s*(?:<[^;{}()\n]*>\s*)?\(" + CPP_RE_EOL,
|
||||
include=cpp_include,
|
||||
exclude=[
|
||||
# The definitions themselves
|
||||
"esphome/core/alloc_helpers.h",
|
||||
"esphome/core/alloc_helpers.cpp",
|
||||
# Backward compatibility re-exports (remove before 2026.11.0)
|
||||
"esphome/core/helpers.h",
|
||||
"esphome/core/helpers.cpp",
|
||||
# Vendored third-party library
|
||||
"esphome/components/http_request/httplib.h",
|
||||
],
|
||||
@@ -1126,7 +1124,6 @@ def lint_no_sprintf(fname, match):
|
||||
# Vendored library
|
||||
"esphome/components/http_request/httplib.h",
|
||||
# Deprecated helpers that return std::string
|
||||
"esphome/core/helpers.cpp",
|
||||
"esphome/core/alloc_helpers.cpp",
|
||||
# The using declaration itself
|
||||
"esphome/core/helpers.h",
|
||||
@@ -1277,12 +1274,6 @@ def lint_no_std_nothrow(fname, match):
|
||||
r"\s*(?:=\s*\{?|[{(])\s*\"",
|
||||
prefilter="TAG",
|
||||
include=["esphome/components/*.cpp", "esphome/components/**/*.cpp"],
|
||||
# Deprecated components, converted in a follow-up PR
|
||||
exclude=[
|
||||
"esphome/components/st7735/*",
|
||||
"esphome/components/st7789v/*",
|
||||
"esphome/components/waveshare_epaper/*",
|
||||
],
|
||||
)
|
||||
def lint_log_tag_macro(fname, match):
|
||||
return (
|
||||
|
||||
@@ -262,8 +262,9 @@ def balance_batches(items: list[_BatchItem], target_seconds: int) -> list[list[s
|
||||
"""Spread items over enough runners to stay near target_seconds each.
|
||||
|
||||
The runner count comes from the total estimate with every grouped build
|
||||
counted once. Heaviest items go first, each to the runner that ends up
|
||||
lightest, so grouped components follow the builds they can join.
|
||||
counted once. Heaviest items go first, each to the runner it adds the
|
||||
fewest seconds to among those ending near the lightest, so grouped
|
||||
components follow the builds they can join.
|
||||
"""
|
||||
if not items:
|
||||
return []
|
||||
@@ -274,10 +275,23 @@ def balance_batches(items: list[_BatchItem], target_seconds: int) -> list[list[s
|
||||
total = whole.seconds
|
||||
count = min(len(items), max(1, math.ceil(total / target_seconds)))
|
||||
batches = [_Batch() for _ in range(count)]
|
||||
# Among the runners ending within slack of the lightest, the one the item
|
||||
# adds the fewest seconds to wins, so a component lands with the bus
|
||||
# group partners it shares builds with; placed away from them it builds
|
||||
# alone on every platform they only share there.
|
||||
slack = target_seconds // 4
|
||||
for item in sorted(items, key=lambda i: (-i.standalone_seconds(), i.component)):
|
||||
min(batches, key=lambda b: (b.seconds + b.added_seconds(item), b.seconds)).add(
|
||||
item
|
||||
costs = [(batch, batch.added_seconds(item)) for batch in batches]
|
||||
ceiling = min(batch.seconds + added for batch, added in costs) + slack
|
||||
batch, _ = min(
|
||||
(
|
||||
(batch, added)
|
||||
for batch, added in costs
|
||||
if batch.seconds + added <= ceiling
|
||||
),
|
||||
key=lambda cost: (cost[1], cost[0].seconds + cost[1]),
|
||||
)
|
||||
batch.add(item)
|
||||
return [batch.components for batch in batches if batch.components]
|
||||
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ from dataclasses import dataclass
|
||||
import hashlib
|
||||
import os
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
@@ -83,7 +84,9 @@ def show_disk_space_if_ci(esphome_command: str) -> None:
|
||||
print("=" * 80)
|
||||
# Use sys.stdout.flush() to ensure output appears immediately
|
||||
sys.stdout.flush()
|
||||
subprocess.run(["df", "-h"], check=False, stdout=sys.stdout, stderr=sys.stderr)
|
||||
# Windows has no df
|
||||
if df := shutil.which("df"):
|
||||
subprocess.run([df, "-h"], check=False, stdout=sys.stdout, stderr=sys.stderr)
|
||||
print("=" * 80 + "\n")
|
||||
sys.stdout.flush()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user