Skip to content

Commit 162f83d

Browse files
Removing lxml and using html5lib to avoid BS4 failing with lxml on HPCs
1 parent e0e5755 commit 162f83d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

pt_cli/connect.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import requests
1212
import bs4
13-
import lxml
1413

1514
logger = logging.getLogger(__name__)
1615

@@ -128,7 +127,7 @@ def maybe_json(self, data):
128127
return loads
129128
except json.decoder.JSONDecodeError:
130129
if isinstance(data, str):
131-
soup = bs4.BeautifulSoup(data, features="lxml")
130+
soup = bs4.BeautifulSoup(data, features="html5lib")
132131
if soup.get_text().startswith("----------"):
133132
sys.stdout.write(soup.get_text())
134133
elif soup.get_text().startswith("Welcome"):

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies = [
2121
"pyyaml>=6.0",
2222
"requests>=2.28",
2323
"beautifulsoup4>=4.12",
24-
"lxml",
24+
"html5lib",
2525
"shtab",
2626
]
2727

0 commit comments

Comments
 (0)