Skip to content

Commit

Permalink
git_deploy: strip comments when parsing python reqs
Browse files Browse the repository at this point in the history
Signed-off-by:  Eric Callahan <[email protected]>
  • Loading branch information
Arksine committed Feb 22, 2023
1 parent fce056e commit 68c5fb6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion moonraker/components/update_manager/git_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,12 @@ async def _parse_python_reqs(self) -> List[str]:
return []
eventloop = self.server.get_event_loop()
data = await eventloop.run_in_thread(pyreqs.read_text)
modules = [mdl.strip() for mdl in data.split("\n") if mdl.strip()]
modules: List[str] = []
for line in data.split("\n"):
line = line.strip()
if not line or line[0] == "#":
continue
modules.append(line)
if not modules:
self.log_info(
f"No modules found in python requirements file: {pyreqs}"
Expand Down

0 comments on commit 68c5fb6

Please sign in to comment.