From 3af45336db4492a15af219da056f3eefe3b9b58e Mon Sep 17 00:00:00 2001 From: Julien Stephan Date: Fri, 21 Aug 2026 10:38:49 +0200 Subject: [PATCH] ci_scripts: parse deprecated.txt comments dynamically Three lines of the deprecated.txt header comment were missing their leading '#', so they parsed as package names. Fix the header, and make create_deprecation_pr() split the file at the first non-comment, non-empty line rather than a hardcoded lines[:7], so the comment block can grow or shrink without breaking the parser. Signed-off-by: Julien Stephan --- ci_scripts/check_versions.py | 9 +++++++-- ci_scripts/deprecated.txt | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ci_scripts/check_versions.py b/ci_scripts/check_versions.py index f67cf8c6..8b883b1a 100755 --- a/ci_scripts/check_versions.py +++ b/ci_scripts/check_versions.py @@ -206,8 +206,13 @@ def create_deprecation_pr(package: str, reason: str) -> Optional[str]: deprecated_file = Path("ci_scripts/deprecated.txt") lines = deprecated_file.read_text().splitlines() - comments = lines[:7] - deprecated_packages = lines[7:] + i = next( + i for i, line in enumerate(lines) + if line.strip() and not line.lstrip().startswith("#") + ) + + comments = lines[:i] + deprecated_packages = lines[i:] if package not in deprecated_packages: deprecated_packages.append(package) diff --git a/ci_scripts/deprecated.txt b/ci_scripts/deprecated.txt index 9ed5e988..61a0e9b2 100644 --- a/ci_scripts/deprecated.txt +++ b/ci_scripts/deprecated.txt @@ -4,9 +4,9 @@ # SPDX-License-Identifier: Apache-2.0 # List of deprecated packages. Deprecated packages are those which are now built -for riscv64 platforms by the upstream projects, so we don't need to maintain a -build workflow for it ourselves. Previously-built wheels should remain in the -RISE package registry. +# for riscv64 platforms by the upstream projects, so we don't need to maintain a +# build workflow for it ourselves. Previously-built wheels should remain in the +# RISE package registry. aiohttp blake3