bench: ignore empty requirements lines (#897)

In particular, this script previously choked on the `home-assistant.in`
requirements file because it contains many empty lines.
This commit is contained in:
Andrew Gallant 2024-01-12 09:39:48 -05:00 committed by GitHub
parent 11b11d04a7
commit cf62d296b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -261,7 +261,9 @@ class Poetry(Suite):
# Parse all dependencies from the requirements file.
with open(requirements_file) as fp:
requirements = [
Requirement(line) for line in fp if not line.lstrip().startswith("#")
Requirement(line)
for line in fp
if not line.lstrip().startswith("#") and len(line.strip()) > 0
]
# Create a Poetry project.