Skip to content

Commit

Permalink
Fix mypy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yaqwsx committed Mar 25, 2024
1 parent 73837fa commit d2af9d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-pcbdraw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
make git librsvg2-bin xvfb xdotool bats
sudo python3 -m pip install mypy
python3 -m pip install -e .\[dev\]
- run: mypy --version
- run: make mypy
- run: make test
- run: make package
Expand Down
12 changes: 6 additions & 6 deletions pcbdraw/mistune_shim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import mistune # type: ignore
# type: ignore
import mistune

__all__ = [
"BaseRenderer",
Expand All @@ -13,16 +14,15 @@
mistune_major_version = mistune_version[0]

if mistune_major_version == 3:
from mistune.plugins.footnotes import \
footnotes as plugin_footnotes # type: ignore
from mistune.plugins.table import table as plugin_table # type: ignore
from mistune.plugins.footnotes import footnotes as plugin_footnotes
from mistune.plugins.table import table as plugin_table

InlineParser = mistune.InlineParser
HTMLRenderer = mistune.HTMLRenderer
BaseRenderer = mistune.BaseRenderer
elif mistune_major_version == 2:
from mistune.plugins.footnotes import plugin_footnotes # type: ignore
from mistune.plugins.table import plugin_table # type: ignore
from mistune.plugins.footnotes import plugin_footnotes
from mistune.plugins.table import plugin_table

InlineParser = mistune.inline_parser.InlineParser
HTMLRenderer = mistune.renderers.HTMLRenderer
Expand Down
2 changes: 1 addition & 1 deletion pcbdraw/populate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pcbdraw.mdrenderer

from .mistune_shim import mistune # type: ignore
from .mistune_shim import (HTMLRenderer, InlineParser, plugin_footnotes,
from .mistune_shim import (HTMLRenderer, InlineParser, plugin_footnotes, plugin_table) # type: ignore
from .pcbnew_common import fakeKiCADGui
from .plot import find_data_file, get_global_datapaths

Expand Down

0 comments on commit d2af9d4

Please sign in to comment.