Skip to content

Commit 045b9bd

Browse files
authored
Merge pull request #836 from tylerjereddy/treddy_lxml_skip
MAINT, TST: lxml optional skip
2 parents abd0ba9 + d41e7fe commit 045b9bd

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

.github/workflows/main_ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ jobs:
6565
name: Install darshan_logs package
6666
run: |
6767
python -m pip install git+https://github.com/darshan-hpc/darshan-logs.git@main
68+
- if: ${{matrix.python-version == 3.8}}
69+
name: Use minimal deps
70+
run: |
71+
# uninstall deps that are not absolute requirements
72+
# to make sure that i.e., tests skip appropriately
73+
python -m pip uninstall -y lxml
6874
- name: Test with pytest
6975
run: |
7076
export LD_LIBRARY_PATH=$PWD/darshan_install/lib

darshan-util/pydarshan/darshan/tests/test_summary.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
from darshan.log_utils import get_log_path, _provide_logs_repo_filepaths
1515
from darshan.experimental.plots.data_access_by_filesystem import plot_with_report
1616

17+
try:
18+
import lxml
19+
has_lxml = True
20+
except ImportError:
21+
has_lxml = False
22+
1723

1824
@pytest.mark.parametrize(
1925
"argv", [
@@ -337,6 +343,9 @@ def test_header_and_footer(self, log_name, expected_header):
337343
def test_metadata_table(self, log_path, expected_df):
338344
# regression test for `summary.ReportData.get_metadata_table()`
339345

346+
if not has_lxml:
347+
pytest.skip("Test requires lxml")
348+
340349
log_path = get_log_path(log_path)
341350
# generate the report data
342351
R = summary.ReportData(log_path=log_path)
@@ -446,6 +455,9 @@ def test_metadata_table(self, log_path, expected_df):
446455
def test_module_table(self, log_path, expected_df, expected_partial_flags):
447456
# regression test for `summary.ReportData.get_module_table()`
448457

458+
if not has_lxml:
459+
pytest.skip("Test requires lxml")
460+
449461
log_path = get_log_path(log_path)
450462
# collect the report data
451463
R = summary.ReportData(log_path=log_path)

darshan-util/pydarshan/mypy.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ ignore_missing_imports = True
3737
[mypy-mako.*]
3838
ignore_missing_imports = True
3939

40+
[mypy-lxml]
41+
ignore_missing_imports = True
42+
4043
# pydarshan modules that lack types
4144
# or currently have errors
4245

0 commit comments

Comments
 (0)