From 21e016d4810f88733bbb01ca0f91b6d8661ed2c3 Mon Sep 17 00:00:00 2001 From: Deimos Date: Wed, 7 Oct 2020 16:13:49 -0600 Subject: [PATCH] Fix "-r" check in invoke update-pip-requirements This needs to check for spaces around the "-r", otherwise it ends up removing comments that include "pyramid-session-redis" and similar. --- tildes/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tildes/tasks.py b/tildes/tasks.py index 49cf288..e97350e 100644 --- a/tildes/tasks.py +++ b/tildes/tasks.py @@ -105,7 +105,7 @@ def update_pip_requirements(context): # remove any comments that include an -r reference # (meaning it's a package that was specifically installed, not a dependency) - cleaned_lines = [re.sub(r"\s+# via.*-r.*", "", line) for line in req_lines] + cleaned_lines = [re.sub(r"\s+# via.* -r .*", "", line) for line in req_lines] with open(out_filename, "w") as req_file: req_file.writelines(cleaned_lines)