Skip to content

Commit 088b259

Browse files
authored
Bump the optional group with 13 updates (#4)
Bumps the optional group with 13 updates: | Package | From | To | | --- | --- | --- | | [markdown](https://github.com/Python-Markdown/markdown) | `3.5` | `3.5.1` | | [pydoclint](https://github.com/jsh9/pydoclint) | `0.3.2` | `0.3.8` | | [black](https://github.com/psf/black) | `23.9.1` | `23.12.0` | | [isort](https://github.com/pycqa/isort) | `5.12.0` | `5.13.1` | | [mkdocs-macros-plugin](https://github.com/fralau/mkdocs_macros_plugin) | `1.0.4` | `1.0.5` | | [mkdocs-material](https://github.com/squidfunk/mkdocs-material) | `9.3.1` | `9.5.2` | | [mkdocstrings[python]](https://github.com/mkdocstrings/mkdocstrings) | `0.23.0` | `0.24.0` | | [mypy](https://github.com/python/mypy) | `1.5.1` | `1.7.1` | | [types-markdown](https://github.com/python/typeshed) | `3.4.2.10` | `3.5.0.3` | | [pylint](https://github.com/pylint-dev/pylint) | `3.0.2` | `3.0.3` | | [pytest](https://github.com/pytest-dev/pytest) | `7.4.2` | `7.4.3` | | [pytest-mock](https://github.com/pytest-dev/pytest-mock) | `3.11.1` | `3.12.0` | | [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) | `0.21.1` | `0.23.2` | Updates `markdown` from 3.5 to 3.5.1 - [Release notes](https://github.com/Python-Markdown/markdown/releases) - [Changelog](https://github.com/Python-Markdown/markdown/blob/master/docs/changelog.md) - [Commits](Python-Markdown/markdown@3.5...3.5.1) Updates `pydoclint` from 0.3.2 to 0.3.8 - [Release notes](https://github.com/jsh9/pydoclint/releases) - [Changelog](https://github.com/jsh9/pydoclint/blob/main/CHANGELOG.md) - [Commits](jsh9/pydoclint@0.3.2...0.3.8) Updates `black` from 23.9.1 to 23.12.0 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](psf/black@23.9.1...23.12.0) Updates `isort` from 5.12.0 to 5.13.1 - [Release notes](https://github.com/pycqa/isort/releases) - [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md) - [Commits](PyCQA/isort@5.12.0...5.13.1) Updates `mkdocs-macros-plugin` from 1.0.4 to 1.0.5 - [Release notes](https://github.com/fralau/mkdocs_macros_plugin/releases) - [Changelog](https://github.com/fralau/mkdocs_macros_plugin/blob/master/CHANGELOG.md) - [Commits](fralau/mkdocs-macros-plugin@v1.0.4...v1.0.5) Updates `mkdocs-material` from 9.3.1 to 9.5.2 - [Release notes](https://github.com/squidfunk/mkdocs-material/releases) - [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG) - [Commits](squidfunk/mkdocs-material@9.3.1...9.5.2) Updates `mkdocstrings[python]` from 0.23.0 to 0.24.0 - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](mkdocstrings/mkdocstrings@0.23.0...0.24.0) Updates `mypy` from 1.5.1 to 1.7.1 - [Changelog](https://github.com/python/mypy/blob/master/CHANGELOG.md) - [Commits](python/mypy@v1.5.1...v1.7.1) Updates `types-markdown` from 3.4.2.10 to 3.5.0.3 - [Commits](https://github.com/python/typeshed/commits) Updates `pylint` from 3.0.2 to 3.0.3 - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](pylint-dev/pylint@v3.0.2...v3.0.3) Updates `pytest` from 7.4.2 to 7.4.3 - [Release notes](https://github.com/pytest-dev/pytest/releases) - [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest@7.4.2...7.4.3) Updates `pytest-mock` from 3.11.1 to 3.12.0 - [Release notes](https://github.com/pytest-dev/pytest-mock/releases) - [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst) - [Commits](pytest-dev/pytest-mock@v3.11.1...v3.12.0) Updates `pytest-asyncio` from 0.21.1 to 0.23.2 - [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases) - [Commits](pytest-dev/pytest-asyncio@v0.21.1...v0.23.2)
2 parents 10097bc + 26dcc6b commit 088b259

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

docs/_scripts/macros.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ def _slugify(text: str) -> str:
2727
Returns:
2828
The slugified text.
2929
"""
30-
# The type of the return value is not defined for the markdown library.
31-
# Also for some reason `mypy` thinks the `toc` module doesn't have a
32-
# `slugify_unicode` function, but it definitely does.
33-
return toc.slugify_unicode(text, "-") # type: ignore[attr-defined,no-any-return]
30+
return toc.slugify_unicode(text, "-")
3431

3532

3633
def _hook_macros_plugin(env: macros.MacrosPlugin) -> None:

mkdocs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ plugins:
100100
alias_type: redirect
101101
canonical_version: latest
102102
- mkdocstrings:
103-
custom_templates: templates
104103
default_handler: python
105104
handlers:
106105
python:

pyproject.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,38 +51,38 @@ dev-flake8 = [
5151
"flake8 == 6.1.0",
5252
"flake8-docstrings == 1.7.0",
5353
"flake8-pyproject == 1.2.3", # For reading the flake8 config from pyproject.toml
54-
"pydoclint == 0.3.2",
54+
"pydoclint == 0.3.8",
5555
"pydocstyle == 6.3.0",
5656
]
57-
dev-formatting = ["black == 23.9.1", "isort == 5.12.0"]
57+
dev-formatting = ["black == 23.12.0", "isort == 5.13.1"]
5858
dev-mkdocs = [
59-
"black == 23.9.1",
60-
"Markdown==3.5",
59+
"black == 23.12.0",
60+
"Markdown==3.5.1",
6161
"mike == 2.0.0",
6262
"mkdocs-gen-files == 0.5.0",
6363
"mkdocs-literate-nav == 0.6.1",
64-
"mkdocs-macros-plugin == 1.0.4",
65-
"mkdocs-material == 9.3.1",
66-
"mkdocstrings[python] == 0.23.0",
64+
"mkdocs-macros-plugin == 1.0.5",
65+
"mkdocs-material == 9.5.2",
66+
"mkdocstrings[python] == 0.24.0",
6767
"frequenz-repo-config[lib] == 0.7.5",
6868
]
6969
dev-mypy = [
70-
"mypy == 1.5.1",
71-
"types-Markdown == 3.4.2.10",
70+
"mypy == 1.7.1",
71+
"types-Markdown == 3.5.0.3",
7272
# For checking the noxfile, docs/ script, and tests
7373
"frequenz-pymdownx-superfences-filter-lines[dev-mkdocs,dev-noxfile,dev-pytest]",
7474
]
7575
dev-noxfile = ["nox == 2023.4.22", "frequenz-repo-config[lib] == 0.7.5"]
7676
dev-pylint = [
77-
"pylint == 3.0.2",
77+
"pylint == 3.0.3",
7878
# For checking the noxfile, docs/ script, and tests
7979
"frequenz-pymdownx-superfences-filter-lines[dev-mkdocs,dev-noxfile,dev-pytest]",
8080
]
8181
dev-pytest = [
82-
"pytest == 7.4.2",
82+
"pytest == 7.4.3",
8383
"frequenz-repo-config[extra-lint-examples] == 0.7.5",
84-
"pytest-mock == 3.11.1",
85-
"pytest-asyncio == 0.21.1",
84+
"pytest-mock == 3.12.0",
85+
"pytest-asyncio == 0.23.2",
8686
"async-solipsism == 0.5",
8787
]
8888
dev = [

src/frequenz/pymdownx/superfences/filter_lines/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from typing import Any, NotRequired, Self, Set, TypedDict, cast
1010

1111
import markdown
12-
from pymdownx.superfences import highlight_validator
12+
from pymdownx.superfences import SuperFencesBlockPreprocessor, highlight_validator
1313

1414

1515
@dataclasses.dataclass(frozen=True, kw_only=True)
@@ -222,7 +222,9 @@ def do_format(
222222
src = "".join(lines)
223223

224224
# Run through default highlighter
225-
return md.preprocessors["fenced_code_block"].highlight(
225+
fenced_code_block = md.preprocessors["fenced_code_block"]
226+
assert isinstance(fenced_code_block, SuperFencesBlockPreprocessor)
227+
return fenced_code_block.highlight(
226228
src=src,
227229
class_name=class_name,
228230
language=language,

tests/test_do_format.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from unittest import mock
99

1010
import pytest
11+
from pymdownx.superfences import SuperFencesBlockPreprocessor
1112

1213
from frequenz.pymdownx.superfences.filter_lines import (
1314
LinesRange,
@@ -21,15 +22,16 @@
2122
def md_mock() -> Iterator[mock.MagicMock]:
2223
"""Mock the `md` object."""
2324
md = mock.MagicMock()
24-
preprocessor = mock.MagicMock()
25-
preprocessor.highlight.side_effect = True
26-
md.preprocessors.return_value = {"fenced_code_block": preprocessor}
25+
preprocessor = mock.MagicMock(spec=SuperFencesBlockPreprocessor)
26+
preprocessor.highlight.return_value = True
27+
preprocessors = {"fenced_code_block": preprocessor}
28+
md.preprocessors.__getitem__.side_effect = preprocessors.__getitem__
2729
yield md
2830

2931

3032
_SOURCE = """\
3133
1. This is some text
32-
2. which have multiple lines
34+
2. which has multiple lines
3335
3. and we want to filter some of them
3436
4. we number them
3537
5. so we can see which ones are filtered
@@ -98,7 +100,7 @@ class _TestCase:
98100
options=Options(show_lines=LinesRanges({LinesRange(end=3)})),
99101
expected_src="""\
100102
1. This is some text
101-
2. which have multiple lines
103+
2. which has multiple lines
102104
3. and we want to filter some of them
103105
""",
104106
),
@@ -107,7 +109,7 @@ class _TestCase:
107109
title="Open range with start and end in the middle",
108110
options=Options(show_lines=LinesRanges({LinesRange(start=2, end=4)})),
109111
expected_src="""\
110-
2. which have multiple lines
112+
2. which has multiple lines
111113
3. and we want to filter some of them
112114
4. we number them
113115
""",
@@ -142,7 +144,7 @@ class _TestCase:
142144
),
143145
expected_src="""\
144146
1. This is some text
145-
2. which have multiple lines
147+
2. which has multiple lines
146148
4. we number them
147149
5. so we can see which ones are filtered
148150
6. and which ones are not

0 commit comments

Comments
 (0)