Skip to content

Commit

Permalink
MAINT: move pattern matching
Browse files Browse the repository at this point in the history
  • Loading branch information
agoose77 committed Dec 14, 2023
1 parent afddf26 commit ecacc0f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ jobs:
cache: "pip"
cache-dependency-path: "pyproject.toml"
- name: Install fonts
# This is required until sphinx-opengraph fixes their fallback
run: sudo apt-get install -y fonts-roboto

- name: Install dependencies
Expand All @@ -106,11 +107,12 @@ jobs:
shell: python
run: |
from pathlib import Path
import re
text = Path("./warnings.txt").read_text().strip()
expected_warning_snippets = ["kitchen-sink", "urllib/parse.py"]
expected_warning_patterns = [r"kitchen\-sink", r"urllib/parse\.py", r"Glyph 10024 .*? missing from current font"]
print("\n=== Sphinx Warnings ===\n\n" + text) # Print just for reference so we can look at the logs
unexpected = [ii for ii in text.split("\n") if not any(snippet in ii for snippet in expected_warning_snippets)]
assert len(unexpected) == 0
unexpected = [l for l in text.splitlines() if not any(re.search(p, ii) for p in expected_warning_patterns)]
assert len(unexpected) == 0, unexpected
- name: Audit with Lighthouse
uses: treosh/[email protected]
Expand Down
6 changes: 0 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os
from urllib.request import urlopen
from pathlib import Path
import warnings

project = "Sphinx Book Theme"
copyright = "2023"
Expand Down Expand Up @@ -36,11 +35,6 @@
"sphinx.ext.todo",
]

# Ignore Glyph 10024 (\N{SPARKLES}) missing from current font from "sphinxext.opengraph"
warnings.filterwarnings(
"ignore", "Glyph 10024 .*? missing from current font", UserWarning
)

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down

0 comments on commit ecacc0f

Please sign in to comment.