From cf62d296b3a373db0fec05f706c7655d9be3bab3 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Fri, 12 Jan 2024 09:39:48 -0500 Subject: [PATCH] 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. --- scripts/bench/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/bench/__main__.py b/scripts/bench/__main__.py index 3b7daeeba..31884ff10 100644 --- a/scripts/bench/__main__.py +++ b/scripts/bench/__main__.py @@ -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.