From 162f83de6024bcdd1378a8424072daee4766f178 Mon Sep 17 00:00:00 2001 From: Paul Stretenowich Date: Fri, 14 Feb 2025 16:43:29 -0500 Subject: [PATCH] Removing lxml and using html5lib to avoid BS4 failing with lxml on HPCs --- pt_cli/connect.py | 3 +-- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pt_cli/connect.py b/pt_cli/connect.py index f1406e6..3776cbd 100755 --- a/pt_cli/connect.py +++ b/pt_cli/connect.py @@ -10,7 +10,6 @@ import requests import bs4 -import lxml logger = logging.getLogger(__name__) @@ -128,7 +127,7 @@ def maybe_json(self, data): return loads except json.decoder.JSONDecodeError: if isinstance(data, str): - soup = bs4.BeautifulSoup(data, features="lxml") + soup = bs4.BeautifulSoup(data, features="html5lib") if soup.get_text().startswith("----------"): sys.stdout.write(soup.get_text()) elif soup.get_text().startswith("Welcome"): diff --git a/pyproject.toml b/pyproject.toml index 3f7f7fd..9c270ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ dependencies = [ "pyyaml>=6.0", "requests>=2.28", "beautifulsoup4>=4.12", - "lxml", + "html5lib", "shtab", ]