Skip to content

Commit aef1917

Browse files
committed
MNT: Fix CI with mypy 0.800
Namely improvements to finding namespace modules (failing test pdoc.test.ApiTest.test_namespace): https://mypy-lang.blogspot.com/2021/01/mypy-0800-released.html python/mypy#4675 (comment)
1 parent 72e41db commit aef1917

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
run: |
6060
find -name '*.md' | xargs .github/lint-markdown.sh
6161
flake8
62-
mypy pdoc
62+
mypy -p pdoc
6363
time coverage run -m unittest -v pdoc.test
6464
PDOC_TEST_PANDOC=1 time catchsegv python -m unittest -v pdoc.test.CliTest.test_pdf_pandoc
6565
bash <(curl -s https://codecov.io/bash)

pdoc/html_helpers.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,10 @@ def glimpse(text: str, max_length=153, *, paragraph=True,
8484
],
8585
extension_configs={
8686
"markdown.extensions.smarty": dict(
87-
smart_dashes=True, # type: ignore[dict-item]
88-
smart_ellipses=True, # type: ignore[dict-item]
89-
smart_quotes=False, # type: ignore[dict-item]
90-
smart_angled_quotes=False, # type: ignore[dict-item]
87+
smart_dashes=True,
88+
smart_ellipses=True,
89+
smart_quotes=False,
90+
smart_angled_quotes=False,
9191
),
9292
},
9393
)
@@ -417,10 +417,10 @@ def to_html(text: str, *,
417417
example template.
418418
"""
419419
# Optionally register our math syntax processor
420-
if not latex_math and _MathPattern.NAME in _md.inlinePatterns: # type: ignore
421-
_md.inlinePatterns.deregister(_MathPattern.NAME) # type: ignore
422-
elif latex_math and _MathPattern.NAME not in _md.inlinePatterns: # type: ignore
423-
_md.inlinePatterns.register(_MathPattern(_MathPattern.PATTERN), # type: ignore
420+
if not latex_math and _MathPattern.NAME in _md.inlinePatterns:
421+
_md.inlinePatterns.deregister(_MathPattern.NAME)
422+
elif latex_math and _MathPattern.NAME not in _md.inlinePatterns:
423+
_md.inlinePatterns.register(_MathPattern(_MathPattern.PATTERN),
424424
_MathPattern.NAME,
425425
_MathPattern.PRIORITY)
426426

0 commit comments

Comments
 (0)