Skip to content

Commit

Permalink
MNT: Fix CI with mypy 0.800
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
kernc committed Jan 23, 2021
1 parent 72e41db commit aef1917
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
run: |
find -name '*.md' | xargs .github/lint-markdown.sh
flake8
mypy pdoc
mypy -p pdoc
time coverage run -m unittest -v pdoc.test
PDOC_TEST_PANDOC=1 time catchsegv python -m unittest -v pdoc.test.CliTest.test_pdf_pandoc
bash <(curl -s https://codecov.io/bash)
Expand Down
16 changes: 8 additions & 8 deletions pdoc/html_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ def glimpse(text: str, max_length=153, *, paragraph=True,
],
extension_configs={
"markdown.extensions.smarty": dict(
smart_dashes=True, # type: ignore[dict-item]
smart_ellipses=True, # type: ignore[dict-item]
smart_quotes=False, # type: ignore[dict-item]
smart_angled_quotes=False, # type: ignore[dict-item]
smart_dashes=True,
smart_ellipses=True,
smart_quotes=False,
smart_angled_quotes=False,
),
},
)
Expand Down Expand Up @@ -417,10 +417,10 @@ def to_html(text: str, *,
example template.
"""
# Optionally register our math syntax processor
if not latex_math and _MathPattern.NAME in _md.inlinePatterns: # type: ignore
_md.inlinePatterns.deregister(_MathPattern.NAME) # type: ignore
elif latex_math and _MathPattern.NAME not in _md.inlinePatterns: # type: ignore
_md.inlinePatterns.register(_MathPattern(_MathPattern.PATTERN), # type: ignore
if not latex_math and _MathPattern.NAME in _md.inlinePatterns:
_md.inlinePatterns.deregister(_MathPattern.NAME)
elif latex_math and _MathPattern.NAME not in _md.inlinePatterns:
_md.inlinePatterns.register(_MathPattern(_MathPattern.PATTERN),
_MathPattern.NAME,
_MathPattern.PRIORITY)

Expand Down

0 comments on commit aef1917

Please sign in to comment.