Skip to content

Commit

Permalink
dependency and lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarkhau committed May 3, 2024
1 parent b3a6697 commit 79d3dbb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions requirements/integration.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ flake8-docstrings
flake8-builtins
flake8-comprehensions
flake8-junit-report
pylint==2.12.1
pylint-ignore>=2020.1013
mypy
# pylint doesn't support isort>=5 for now
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ disable =
line-too-long,
logging-not-lazy,
logging-fstring-interpolation,
consider-using-f-string,
no-else-return,
no-else-raise,
too-few-public-methods,
Expand Down
12 changes: 10 additions & 2 deletions src/markdown_aafigure/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ def draw_aafig(block_text: str, default_options: Options = None) -> str:

def draw_aafigure(block_text: str, filename: typ.Any = None, output_fmt: str = 'svg') -> bytes:
# pylint:disable=unused-argument
warnings.warn("draw_aafigure is depricated use 'draw_aafig' instead", DeprecationWarning)
warnings.warn(
"draw_aafigure is depricated use 'draw_aafig' instead",
DeprecationWarning,
stacklevel=2,
)
if output_fmt == 'png':
tag_type = 'img_base64_png'
elif output_fmt == 'svg':
Expand All @@ -165,7 +169,11 @@ def draw_aafigure(block_text: str, filename: typ.Any = None, output_fmt: str = '


def fig2img_uri(block_text: str, output_fmt: str = 'svg', encoding: str = 'base64') -> str:
warnings.warn("fig2img_uri is depricated use 'draw_aafig' instead", DeprecationWarning)
warnings.warn(
"fig2img_uri is depricated use 'draw_aafig' instead",
DeprecationWarning,
stacklevel=2,
)
if output_fmt == 'png':
tag_type = 'img_base64_png'
elif output_fmt == 'svg' and encoding == 'utf-8':
Expand Down
4 changes: 2 additions & 2 deletions test/test_aafigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def test_param_aafigure():
assert 'stroke="#ff0000"' in fig_html

result = md.markdown(PARAM_BLOCK_TXT, extensions=['markdown_aafigure'])
with open("/tmp/aafig_result.html", mode="w") as fobj:
with open("/tmp/aafig_result.html", mode="w", encoding="utf-8") as fobj:
fobj.write(result)

expected = "<p>{}</p>".format(fig_html)
Expand Down Expand Up @@ -266,7 +266,7 @@ def test_html_output():
# in the browser (for warnings in devtools).
extensions = DEFAULT_MKDOCS_EXTENSIONS + ['markdown_aafigure']
result = md.markdown(HTMLTEST_TXT, extensions=extensions)
with open("/tmp/aafigure.html", mode="w") as fobj:
with open("/tmp/aafigure.html", mode="w", encoding="utf-8") as fobj:
fobj.write(result)


Expand Down

0 comments on commit 79d3dbb

Please sign in to comment.