From 33363ef07bfbce2b4628886b3992443b81ccdc31 Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Mon, 8 Jun 2026 11:37:49 +0000 Subject: [PATCH] Fix autogenerated comment --- requirements_all.lock | 2 +- requirements_ci.lock | 2 +- script/gen_requirements_all.py | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/requirements_all.lock b/requirements_all.lock index 3652a68e0daf..6d757e8a5e83 100644 --- a/requirements_all.lock +++ b/requirements_all.lock @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --generate-hashes --output-file requirements_all.lock requirements_all.txt +# Automatically generated by gen_requirements_all.py, do not edit accuweather==5.1.0 \ --hash=sha256:87e7e62760c7afbd217d3fcca358e53765aa000df524ec15a5d17cebb1a28b61 \ --hash=sha256:da048af53e67392e8eb2666822f6f2b5d3d3a0232c88dbc04050678a75e9543c diff --git a/requirements_ci.lock b/requirements_ci.lock index 1450cfa6fa31..dfea0eb74c6f 100644 --- a/requirements_ci.lock +++ b/requirements_ci.lock @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile --generate-hashes --output-file requirements_ci.lock requirements_all.txt requirements_test.txt +# Automatically generated by gen_requirements_all.py, do not edit accuweather==5.1.0 \ --hash=sha256:87e7e62760c7afbd217d3fcca358e53765aa000df524ec15a5d17cebb1a28b61 \ --hash=sha256:da048af53e67392e8eb2666822f6f2b5d3d3a0232c88dbc04050678a75e9543c diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index 1b2e12f6533d..84ee5df15c42 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -244,9 +244,9 @@ coloredlogs==15.0.1 setuptools==81.0.0 """ -GENERATED_MESSAGE = ( - f"# Automatically generated by {Path(__file__).name}, do not edit\n\n" -) +GENERATED_MESSAGE = f"Automatically generated by {Path(__file__).name}, do not edit" + +GENERATED_MESSAGE_AS_COMMENT = f"# {GENERATED_MESSAGE}\n\n" MAP_HOOK_ID_TO_PACKAGE = { "ruff-check": "ruff", @@ -465,7 +465,7 @@ def generate_action_requirements_list(reqs: dict[str, list[str]], action: str) - def requirements_output() -> str: """Generate output for requirements.""" output = [ - GENERATED_MESSAGE, + GENERATED_MESSAGE_AS_COMMENT, "-c homeassistant/package_constraints.txt\n", "\n", "# Home Assistant Core\n", @@ -485,7 +485,7 @@ def requirements_all_output(reqs: dict[str, list[str]]) -> str: """Generate output for requirements_all.""" output = [ "# Home Assistant Core, full dependency set\n", - GENERATED_MESSAGE, + GENERATED_MESSAGE_AS_COMMENT, "-r requirements.txt\n", ] output.append(generate_requirements_list(reqs)) @@ -497,7 +497,7 @@ def requirements_all_action_output(reqs: dict[str, list[str]], action: str) -> s """Generate output for requirements_all_{action}.""" output = [ f"# Home Assistant Core, full dependency set for {action}\n", - GENERATED_MESSAGE, + GENERATED_MESSAGE_AS_COMMENT, "-r requirements.txt\n", ] output.append(generate_action_requirements_list(reqs, action)) @@ -531,7 +531,7 @@ def requirements_pre_commit_output() -> str: def gather_constraints() -> str: """Construct output for constraint file.""" return ( - GENERATED_MESSAGE + GENERATED_MESSAGE_AS_COMMENT + "\n".join( [ *sorted( @@ -577,6 +577,8 @@ def generate_lock_file(output_path: str, source_file: tuple[str, ...]) -> None: "--quiet", "--output-file", output_path, + "--custom-compile-command", + GENERATED_MESSAGE, *source_file, ], check=True, @@ -650,7 +652,6 @@ def main(validate: bool, ci: bool) -> int: for lock_file, source_files in PIP_COMPILE_LOCK_FILES.items(): for source_file in source_files: sourcefile_to_lockfile.setdefault(source_file, []).append(lock_file) - print(sourcefile_to_lockfile) generate_lock_files = set() for filename, content in files: