From 2e88c86f1059f918390ff24f35c618e29e4e44c6 Mon Sep 17 00:00:00 2001 From: yuanjingx87 <197832395+yuanjingx87@users.noreply.github.com> Date: Thu, 18 Dec 2025 17:41:23 -0800 Subject: [PATCH] [None][infra] Fix issue that lock file geneartion will skip dependency with comment (#10144) Signed-off-by: Yuanjing Xue <197832395+yuanjingx87@users.noreply.github.com> --- scripts/generate_lock_file.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/generate_lock_file.py b/scripts/generate_lock_file.py index 9b37858c0e..5a0992902c 100755 --- a/scripts/generate_lock_file.py +++ b/scripts/generate_lock_file.py @@ -156,9 +156,10 @@ if __name__ == "__main__": packages = packages[:-1] for package in packages: + package = re.sub(r'\s#.*$', '', package).rstrip() # WAR: ignore lines with "-f": No tool exists to parse complex requirements.txt - if '-f' in package or \ - "#" in package or \ + if not package or \ + '-f' in package or \ package.startswith('--'): continue