[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>
This commit is contained in:
yuanjingx87 2025-12-18 17:41:23 -08:00 committed by GitHub
parent bd5b3c2ac0
commit 2e88c86f10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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