Skip to content

Commit ecacc0f

Browse files
committed
MAINT: move pattern matching
1 parent afddf26 commit ecacc0f

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ jobs:
8585
cache: "pip"
8686
cache-dependency-path: "pyproject.toml"
8787
- name: Install fonts
88+
# This is required until sphinx-opengraph fixes their fallback
8889
run: sudo apt-get install -y fonts-roboto
8990

9091
- name: Install dependencies
@@ -106,11 +107,12 @@ jobs:
106107
shell: python
107108
run: |
108109
from pathlib import Path
110+
import re
109111
text = Path("./warnings.txt").read_text().strip()
110-
expected_warning_snippets = ["kitchen-sink", "urllib/parse.py"]
112+
expected_warning_patterns = [r"kitchen\-sink", r"urllib/parse\.py", r"Glyph 10024 .*? missing from current font"]
111113
print("\n=== Sphinx Warnings ===\n\n" + text) # Print just for reference so we can look at the logs
112-
unexpected = [ii for ii in text.split("\n") if not any(snippet in ii for snippet in expected_warning_snippets)]
113-
assert len(unexpected) == 0
114+
unexpected = [l for l in text.splitlines() if not any(re.search(p, ii) for p in expected_warning_patterns)]
115+
assert len(unexpected) == 0, unexpected
114116
115117
- name: Audit with Lighthouse
116118
uses: treosh/[email protected]

docs/conf.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import os
33
from urllib.request import urlopen
44
from pathlib import Path
5-
import warnings
65

76
project = "Sphinx Book Theme"
87
copyright = "2023"
@@ -36,11 +35,6 @@
3635
"sphinx.ext.todo",
3736
]
3837

39-
# Ignore Glyph 10024 (\N{SPARKLES}) missing from current font from "sphinxext.opengraph"
40-
warnings.filterwarnings(
41-
"ignore", "Glyph 10024 .*? missing from current font", UserWarning
42-
)
43-
4438
# Add any paths that contain templates here, relative to this directory.
4539
templates_path = ["_templates"]
4640

0 commit comments

Comments
 (0)