From edd031131962d6e2f1d936c9c5ee04f1c2c8e629 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 02:31:00 +0000 Subject: [PATCH 1/2] Bump the pip group with 31 updates Bumps the pip group with 31 updates: | Package | From | To | | --- | --- | --- | | [click](https://github.com/pallets/click) | `7.0` | `8.1.8` | | [jinja2](https://github.com/pallets/jinja) | `2.11.1` | `3.1.6` | | [markupsafe](https://github.com/pallets/markupsafe) | `2.0.1` | `3.0.3` | | [markdown](https://github.com/Python-Markdown/markdown) | `3.3.6` | `3.9` | | [pyyaml](https://github.com/yaml/pyyaml) | `5.1` | `6.0.3` | | [watchdog](https://github.com/gorakhargosh/watchdog) | `2.0` | `6.0.0` | | [ghp-import](https://github.com/c-w/ghp-import) | `1.0` | `2.1.0` | | [pyyaml-env-tag](https://github.com/waylan/pyyaml-env-tag) | `0.1` | `1.1` | | [packaging](https://github.com/pypa/packaging) | `20.5` | `26.1` | | [pathspec](https://github.com/cpburnz/python-pathspec) | `0.11.1` | `1.0.4` | | [mkdocs-get-deps](https://github.com/mkdocs/get-deps) | `0.2.0` | `0.2.2` | | [colorama](https://github.com/tartley/colorama) | `0.4` | `0.4.6` | | [babel](https://github.com/python-babel/babel) | `2.9.0` | `2.18.0` | | [griffe](https://github.com/mkdocstrings/griffe) | `0.38.0` | `1.14.0` | | [markdown-callouts](https://github.com/oprypin/markdown-callouts) | `0.3.0` | `0.4.0` | | [mdx-gh-links](https://github.com/Python-Markdown/github-links) | `0.3.1` | `0.4` | | [mkdocs](https://github.com/mkdocs/mkdocs) | `1.5.3` | `1.6.1` | | [mkdocs-autorefs](https://github.com/mkdocstrings/autorefs) | `0.5.0` | `1.4.4` | | [mkdocs-click](https://github.com/mkdocs/mkdocs-click) | `0.8.1` | `0.9.0` | | [mkdocs-literate-nav](https://github.com/oprypin/mkdocs-literate-nav) | `0.6.1` | `0.6.3` | | [mkdocs-redirects](https://github.com/ProperDocs/properdocs-redirects) | `1.2.1` | `1.2.2` | | [mkdocstrings](https://github.com/mkdocstrings/mkdocstrings) | `0.24.0` | `0.30.1` | | [mkdocstrings-python](https://github.com/mkdocstrings/python) | `1.7.5` | `1.18.2` | | [platformdirs](https://github.com/tox-dev/platformdirs) | `4.0.0` | `4.4.0` | | [pymdown-extensions](https://github.com/facelessuser/pymdown-extensions) | `10.4` | `10.21.2` | | [python-dateutil](https://github.com/dateutil/dateutil) | `2.8.2` | `2.9.0.post0` | | [six](https://github.com/benjaminp/six) | `1.16.0` | `1.17.0` | | [black](https://github.com/psf/black) | `23.12.1` | `25.11.0` | | [isort](https://github.com/PyCQA/isort) | `5.13.2` | `6.1.0` | | [mypy-extensions](https://github.com/python/mypy_extensions) | `1.0.0` | `1.1.0` | | [ruff](https://github.com/astral-sh/ruff) | `0.1.14` | `0.15.11` | Updates `click` from 7.0 to 8.1.8 - [Release notes](https://github.com/pallets/click/releases) - [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/click/compare/7.0...8.1.8) Updates `jinja2` from 2.11.1 to 3.1.6 - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/2.11.1...3.1.6) Updates `markupsafe` from 2.0.1 to 3.0.3 - [Release notes](https://github.com/pallets/markupsafe/releases) - [Changelog](https://github.com/pallets/markupsafe/blob/main/CHANGES.rst) - [Commits](https://github.com/pallets/markupsafe/compare/2.0.1...3.0.3) Updates `markdown` from 3.3.6 to 3.9 - [Release notes](https://github.com/Python-Markdown/markdown/releases) - [Changelog](https://github.com/Python-Markdown/markdown/blob/master/docs/changelog.md) - [Commits](https://github.com/Python-Markdown/markdown/compare/3.3.6...3.9.0) Updates `pyyaml` from 5.1 to 6.0.3 - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/6.0.3/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/5.1...6.0.3) Updates `watchdog` from 2.0 to 6.0.0 - [Release notes](https://github.com/gorakhargosh/watchdog/releases) - [Changelog](https://github.com/gorakhargosh/watchdog/blob/master/changelog.rst) - [Commits](https://github.com/gorakhargosh/watchdog/compare/v2.0.0...v6.0.0) Updates `ghp-import` from 1.0 to 2.1.0 - [Commits](https://github.com/c-w/ghp-import/compare/1.0.0...2.1.0) Updates `pyyaml-env-tag` from 0.1 to 1.1 - [Commits](https://github.com/waylan/pyyaml-env-tag/compare/0.1...1.1) Updates `packaging` from 20.5 to 26.1 - [Release notes](https://github.com/pypa/packaging/releases) - [Changelog](https://github.com/pypa/packaging/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pypa/packaging/compare/20.5...26.1) Updates `pathspec` from 0.11.1 to 1.0.4 - [Release notes](https://github.com/cpburnz/python-pathspec/releases) - [Changelog](https://github.com/cpburnz/python-pathspec/blob/master/CHANGES.rst) - [Commits](https://github.com/cpburnz/python-pathspec/compare/v0.11.1...v1.0.4) Updates `mkdocs-get-deps` from 0.2.0 to 0.2.2 - [Commits](https://github.com/mkdocs/get-deps/commits) Updates `colorama` from 0.4 to 0.4.6 - [Changelog](https://github.com/tartley/colorama/blob/master/CHANGELOG.rst) - [Commits](https://github.com/tartley/colorama/compare/0.4.0...0.4.6) Updates `babel` from 2.9.0 to 2.18.0 - [Release notes](https://github.com/python-babel/babel/releases) - [Changelog](https://github.com/python-babel/babel/blob/master/CHANGES.rst) - [Commits](https://github.com/python-babel/babel/compare/v2.9.0...v2.18.0) Updates `griffe` from 0.38.0 to 1.14.0 - [Release notes](https://github.com/mkdocstrings/griffe/releases) - [Changelog](https://github.com/mkdocstrings/griffe/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/griffe/compare/0.38.0...1.14.0) Updates `markdown-callouts` from 0.3.0 to 0.4.0 - [Release notes](https://github.com/oprypin/markdown-callouts/releases) - [Commits](https://github.com/oprypin/markdown-callouts/compare/v0.3.0...v0.4.0) Updates `mdx-gh-links` from 0.3.1 to 0.4 - [Commits](https://github.com/Python-Markdown/github-links/compare/0.3.1...0.4) Updates `mkdocs` from 1.5.3 to 1.6.1 - [Release notes](https://github.com/mkdocs/mkdocs/releases) - [Commits](https://github.com/mkdocs/mkdocs/compare/1.5.3...1.6.1) Updates `mkdocs-autorefs` from 0.5.0 to 1.4.4 - [Release notes](https://github.com/mkdocstrings/autorefs/releases) - [Changelog](https://github.com/mkdocstrings/autorefs/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/autorefs/compare/0.5.0...1.4.4) Updates `mkdocs-click` from 0.8.1 to 0.9.0 - [Release notes](https://github.com/mkdocs/mkdocs-click/releases) - [Changelog](https://github.com/mkdocs/mkdocs-click/blob/master/CHANGELOG.md) - [Commits](https://github.com/mkdocs/mkdocs-click/compare/0.8.1...0.9.0) Updates `mkdocs-literate-nav` from 0.6.1 to 0.6.3 - [Release notes](https://github.com/oprypin/mkdocs-literate-nav/releases) - [Commits](https://github.com/oprypin/mkdocs-literate-nav/compare/v0.6.1...v0.6.3) Updates `mkdocs-redirects` from 1.2.1 to 1.2.2 - [Release notes](https://github.com/ProperDocs/properdocs-redirects/releases) - [Commits](https://github.com/ProperDocs/properdocs-redirects/compare/v1.2.1...v1.2.2) Updates `mkdocstrings` from 0.24.0 to 0.30.1 - [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases) - [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/mkdocstrings/compare/0.24.0...0.30.1) Updates `mkdocstrings-python` from 1.7.5 to 1.18.2 - [Release notes](https://github.com/mkdocstrings/python/releases) - [Changelog](https://github.com/mkdocstrings/python/blob/main/CHANGELOG.md) - [Commits](https://github.com/mkdocstrings/python/compare/1.7.5...1.18.2) Updates `platformdirs` from 4.0.0 to 4.4.0 - [Release notes](https://github.com/tox-dev/platformdirs/releases) - [Changelog](https://github.com/tox-dev/platformdirs/blob/main/docs/changelog.rst) - [Commits](https://github.com/tox-dev/platformdirs/compare/4.0.0...4.4.0) Updates `pymdown-extensions` from 10.4 to 10.21.2 - [Release notes](https://github.com/facelessuser/pymdown-extensions/releases) - [Commits](https://github.com/facelessuser/pymdown-extensions/compare/10.4...10.21.2) Updates `python-dateutil` from 2.8.2 to 2.9.0.post0 - [Release notes](https://github.com/dateutil/dateutil/releases) - [Changelog](https://github.com/dateutil/dateutil/blob/master/NEWS) - [Commits](https://github.com/dateutil/dateutil/compare/2.8.2...2.9.0.post0) Updates `six` from 1.16.0 to 1.17.0 - [Changelog](https://github.com/benjaminp/six/blob/main/CHANGES) - [Commits](https://github.com/benjaminp/six/compare/1.16.0...1.17.0) Updates `black` from 23.12.1 to 25.11.0 - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](https://github.com/psf/black/compare/23.12.1...25.11.0) Updates `isort` from 5.13.2 to 6.1.0 - [Release notes](https://github.com/PyCQA/isort/releases) - [Changelog](https://github.com/PyCQA/isort/blob/main/CHANGELOG.md) - [Commits](https://github.com/PyCQA/isort/compare/5.13.2...6.1.0) Updates `mypy-extensions` from 1.0.0 to 1.1.0 - [Commits](https://github.com/python/mypy_extensions/compare/1.0.0...1.1.0) Updates `ruff` from 0.1.14 to 0.15.11 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/v0.1.14...0.15.11) --- updated-dependencies: - dependency-name: click dependency-version: 8.1.8 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: jinja2 dependency-version: 3.1.6 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: markupsafe dependency-version: 3.0.3 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: markdown dependency-version: '3.9' dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: pyyaml dependency-version: 6.0.3 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: watchdog dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: ghp-import dependency-version: 2.1.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: pyyaml-env-tag dependency-version: '1.1' dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: packaging dependency-version: '26.1' dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: pathspec dependency-version: 1.0.4 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: mkdocs-get-deps dependency-version: 0.2.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip - dependency-name: colorama dependency-version: 0.4.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip - dependency-name: babel dependency-version: 2.18.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: pip - dependency-name: griffe dependency-version: 1.14.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: markdown-callouts dependency-version: 0.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: mdx-gh-links dependency-version: '0.4' dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: mkdocs dependency-version: 1.6.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: mkdocs-autorefs dependency-version: 1.4.4 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: mkdocs-click dependency-version: 0.9.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: mkdocs-literate-nav dependency-version: 0.6.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip - dependency-name: mkdocs-redirects dependency-version: 1.2.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: pip - dependency-name: mkdocstrings dependency-version: 0.30.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: mkdocstrings-python dependency-version: 1.18.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: platformdirs dependency-version: 4.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: pymdown-extensions dependency-version: 10.21.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: python-dateutil dependency-version: 2.9.0.post0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: six dependency-version: 1.17.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: black dependency-version: 25.11.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: isort dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: pip - dependency-name: mypy-extensions dependency-version: 1.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip - dependency-name: ruff dependency-version: 0.15.11 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: pip ... Signed-off-by: dependabot[bot] --- pyproject.toml | 26 ++++++++-------- requirements/requirements-docs.txt | 48 ++++++++++++++--------------- requirements/requirements-style.txt | 16 +++++----- 3 files changed, 45 insertions(+), 45 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bacfbaa0..ec864a75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,21 +55,21 @@ i18n = [ "babel >=2.9.0", ] min-versions = [ - "click ==7.0", - "Jinja2 ==2.11.1", - "markupsafe ==2.0.1", - "Markdown ==3.3.6", - "PyYAML ==5.1", - "watchdog ==2.0", - "ghp-import ==1.0", - "pyyaml_env_tag ==0.1", + "click ==8.1.8", + "Jinja2 ==3.1.6", + "markupsafe ==3.0.3", + "Markdown ==3.9", + "PyYAML ==6.0.3", + "watchdog ==6.0.0", + "ghp-import ==2.1.0", + "pyyaml_env_tag ==1.1", "importlib-metadata ==4.4; python_version < '3.10'", - "packaging ==20.5", + "packaging ==26.1", "mergedeep ==1.3.4", - "pathspec ==0.11.1", - "mkdocs-get-deps ==0.2.0", - "colorama ==0.4; platform_system == 'Windows'", - "babel ==2.9.0", + "pathspec ==1.0.4", + "mkdocs-get-deps ==0.2.2", + "colorama ==0.4.6; platform_system == 'Windows'", + "babel ==2.18.0", ] [project.urls] diff --git a/requirements/requirements-docs.txt b/requirements/requirements-docs.txt index 87133cae..670f9bf0 100644 --- a/requirements/requirements-docs.txt +++ b/requirements/requirements-docs.txt @@ -27,7 +27,7 @@ # - watchdog>=2.0 # -click==8.1.7 +click==8.1.8 # via # hatch.envs.docs # mkdocs @@ -39,14 +39,14 @@ ghp-import==2.1.0 # via # hatch.envs.docs # mkdocs -griffe==0.38.0 +griffe==1.14.0 # via mkdocstrings-python -jinja2==3.1.2 +jinja2==3.1.6 # via # hatch.envs.docs # mkdocs # mkdocstrings -markdown==3.5.1 +markdown==3.9 # via # hatch.envs.docs # markdown-callouts @@ -56,79 +56,79 @@ markdown==3.5.1 # mkdocs-click # mkdocstrings # pymdown-extensions -markdown-callouts==0.3.0 +markdown-callouts==0.4.0 # via hatch.envs.docs -markupsafe==2.1.3 +markupsafe==3.0.3 # via # hatch.envs.docs # jinja2 # mkdocs # mkdocstrings -mdx-gh-links==0.3.1 +mdx-gh-links==0.4 # via hatch.envs.docs mergedeep==1.3.4 # via # hatch.envs.docs # mkdocs # mkdocs-get-deps -mkdocs==1.5.3 +mkdocs==1.6.1 # via # hatch.envs.docs # mkdocs-autorefs # mkdocs-literate-nav # mkdocs-redirects # mkdocstrings -mkdocs-autorefs==0.5.0 +mkdocs-autorefs==1.4.4 # via # hatch.envs.docs # mkdocstrings -mkdocs-click==0.8.1 +mkdocs-click==0.9.0 # via hatch.envs.docs -mkdocs-get-deps==0.2.0 +mkdocs-get-deps==0.2.2 # via hatch.envs.docs -mkdocs-literate-nav==0.6.1 +mkdocs-literate-nav==0.6.3 # via hatch.envs.docs -mkdocs-redirects==1.2.1 +mkdocs-redirects==1.2.2 # via hatch.envs.docs -mkdocstrings==0.24.0 +mkdocstrings==0.30.1 # via # hatch.envs.docs # mkdocstrings-python -mkdocstrings-python==1.7.5 +mkdocstrings-python==1.18.2 # via hatch.envs.docs -packaging==23.2 +packaging==26.1 # via # hatch.envs.docs # mkdocs -pathspec==0.11.2 +pathspec==1.0.4 # via # hatch.envs.docs # mkdocs -platformdirs==4.0.0 +platformdirs==4.4.0 # via # mkdocs # mkdocs-get-deps # mkdocstrings -pymdown-extensions==10.4 +pymdown-extensions==10.21.2 # via # hatch.envs.docs # mkdocstrings -python-dateutil==2.8.2 +python-dateutil==2.9.0.post0 # via ghp-import -pyyaml==6.0.1 +pyyaml==6.0.3 # via # hatch.envs.docs # mkdocs # mkdocs-get-deps # pymdown-extensions # pyyaml-env-tag -pyyaml-env-tag==0.1 +pyyaml-env-tag==1.1 # via # hatch.envs.docs # mkdocs -six==1.16.0 +six==1.17.0 # via python-dateutil -watchdog==3.0.0 +watchdog==6.0.0 # via # hatch.envs.docs # mkdocs diff --git a/requirements/requirements-style.txt b/requirements/requirements-style.txt index 596540f5..a022836f 100644 --- a/requirements/requirements-style.txt +++ b/requirements/requirements-style.txt @@ -6,19 +6,19 @@ # - ruff # -black==23.12.1 +black==25.11.0 # via hatch.envs.style -click==8.1.7 +click==8.1.8 # via black -isort==5.13.2 +isort==6.1.0 # via hatch.envs.style -mypy-extensions==1.0.0 +mypy-extensions==1.1.0 # via black -packaging==23.2 +packaging==26.1 # via black -pathspec==0.12.1 +pathspec==1.0.4 # via black -platformdirs==4.1.0 +platformdirs==4.4.0 # via black -ruff==0.1.14 +ruff==0.15.11 # via hatch.envs.style From 0a5623656b4b4437ad504da88ee68459a9202ba3 Mon Sep 17 00:00:00 2001 From: shenxianpeng Date: Wed, 22 Apr 2026 05:44:20 +0300 Subject: [PATCH 2/2] Fix style and lint issues for updated tool versions - Apply black/isort/ruff formatting changes required by new tool versions (black 25.11.0, isort 6.1.0, ruff 0.15.11) - Migrate ruff config from deprecated [tool.ruff] to [tool.ruff.lint] - Remove deprecated PGH002 rule (remapped to G010 in newer ruff) - Add PLC0415 to ignore list (lazy imports are intentional throughout) - Fix RUF005 in __main__.py: use iterable unpacking instead of concatenation --- mkdocs/__main__.py | 2 +- mkdocs/config/base.py | 6 ++---- mkdocs/config/config_options.py | 30 ++++++++++-------------------- mkdocs/plugins.py | 6 ++---- mkdocs/structure/__init__.py | 3 +-- mkdocs/structure/nav.py | 16 ++++++++++------ mkdocs/structure/toc.py | 1 + mkdocs/tests/integration.py | 1 - mkdocs/utils/__init__.py | 1 + mkdocs/utils/meta.py | 1 + pyproject.toml | 8 ++++---- 11 files changed, 33 insertions(+), 42 deletions(-) diff --git a/mkdocs/__main__.py b/mkdocs/__main__.py index a2f7594c..ec8696c7 100644 --- a/mkdocs/__main__.py +++ b/mkdocs/__main__.py @@ -36,7 +36,7 @@ def _showwarning(message, category, filename, lineno, file=None, line=None): stack = [frame for frame in traceback.extract_stack() if frame.line][-4:-2] # Make sure the actual affected file's name is still present (the case of syntax warning): if not any(frame.filename == filename for frame in stack): - stack = stack[-1:] + [traceback.FrameSummary(filename, lineno, '')] + stack = [*stack[-1:], traceback.FrameSummary(filename, lineno, '')] tb = ''.join(traceback.format_list(stack)) except Exception: diff --git a/mkdocs/config/base.py b/mkdocs/config/base.py index d21b42ab..e75a9aeb 100644 --- a/mkdocs/config/base.py +++ b/mkdocs/config/base.py @@ -86,12 +86,10 @@ def __set_name__(self, owner, name): self._name = name @overload - def __get__(self, obj: Config, type=None) -> T: - ... + def __get__(self, obj: Config, type=None) -> T: ... @overload - def __get__(self, obj, type=None) -> BaseConfigOption: - ... + def __get__(self, obj, type=None) -> BaseConfigOption: ... def __get__(self, obj, type=None): if not isinstance(obj, Config): diff --git a/mkdocs/config/config_options.py b/mkdocs/config/config_options.py index 2d08b92e..7e3a7a6c 100644 --- a/mkdocs/config/config_options.py +++ b/mkdocs/config/config_options.py @@ -155,12 +155,10 @@ class OptionallyRequired(Generic[T], BaseConfigOption[T]): """ @overload - def __init__(self, default=None): - ... + def __init__(self, default=None): ... @overload - def __init__(self, default=None, *, required: bool): - ... + def __init__(self, default=None, *, required: bool): ... def __init__(self, default=None, required=None): super().__init__() @@ -308,12 +306,10 @@ class ConfigItems(ListOfItems[LegacyConfig]): """ @overload - def __init__(self, *config_options: PlainConfigSchemaItem): - ... + def __init__(self, *config_options: PlainConfigSchemaItem): ... @overload - def __init__(self, *config_options: PlainConfigSchemaItem, required: bool): - ... + def __init__(self, *config_options: PlainConfigSchemaItem, required: bool): ... def __init__(self, *config_options: PlainConfigSchemaItem, required=None) -> None: super().__init__(SubConfig(*config_options), default=[]) @@ -329,12 +325,10 @@ class Type(Generic[T], OptionallyRequired[T]): """ @overload - def __init__(self, type_: type[T], /, length: int | None = None, **kwargs): - ... + def __init__(self, type_: type[T], /, length: int | None = None, **kwargs): ... @overload - def __init__(self, type_: tuple[type[T], ...], /, length: int | None = None, **kwargs): - ... + def __init__(self, type_: tuple[type[T], ...], /, length: int | None = None, **kwargs): ... def __init__(self, type_, /, length=None, **kwargs) -> None: super().__init__(**kwargs) @@ -498,12 +492,10 @@ class URL(OptionallyRequired[str]): """ @overload - def __init__(self, default=None, *, is_dir: bool = False): - ... + def __init__(self, default=None, *, is_dir: bool = False): ... @overload - def __init__(self, default=None, *, required: bool, is_dir: bool = False): - ... + def __init__(self, default=None, *, required: bool, is_dir: bool = False): ... def __init__(self, default=None, required=None, is_dir: bool = False) -> None: self.is_dir = is_dir @@ -760,12 +752,10 @@ class ListOfPaths(ListOfItems[str]): """ @overload - def __init__(self, default=[]): - ... + def __init__(self, default=[]): ... @overload - def __init__(self, default=[], *, required: bool): - ... + def __init__(self, default=[], *, required: bool): ... def __init__(self, default=[], required=None) -> None: super().__init__(FilesystemObject(exists=True), default) diff --git a/mkdocs/plugins.py b/mkdocs/plugins.py index f3dcb996..9c06e9a1 100644 --- a/mkdocs/plugins.py +++ b/mkdocs/plugins.py @@ -541,12 +541,10 @@ def __setitem__(self, key: str, value: BasePlugin) -> None: self._register_event(event_name[3:], method, plugin_name=key) @overload - def run_event(self, name: str, **kwargs) -> Any: - ... + def run_event(self, name: str, **kwargs) -> Any: ... @overload - def run_event(self, name: str, item: T, **kwargs) -> T: - ... + def run_event(self, name: str, item: T, **kwargs) -> T: ... def run_event(self, name: str, item=None, **kwargs): """ diff --git a/mkdocs/structure/__init__.py b/mkdocs/structure/__init__.py index c99b6575..64a890c9 100644 --- a/mkdocs/structure/__init__.py +++ b/mkdocs/structure/__init__.py @@ -11,8 +11,7 @@ class StructureItem(metaclass=abc.ABCMeta): """An item in MkDocs structure - see concrete subclasses Section, Page or Link.""" @abc.abstractmethod - def __init__(self): - ... + def __init__(self): ... parent: Section | None = None """The immediate parent of the item in the site navigation. `None` if it's at the top level.""" diff --git a/mkdocs/structure/nav.py b/mkdocs/structure/nav.py index 21815fe6..756f6333 100644 --- a/mkdocs/structure/nav.py +++ b/mkdocs/structure/nav.py @@ -188,16 +188,20 @@ def get_navigation(files: Files, config: MkDocsConfig) -> Navigation: def _data_to_navigation(data, files: Files, config: MkDocsConfig): if isinstance(data, dict): return [ - _data_to_navigation((key, value), files, config) - if isinstance(value, str) - else Section(title=key, children=_data_to_navigation(value, files, config)) + ( + _data_to_navigation((key, value), files, config) + if isinstance(value, str) + else Section(title=key, children=_data_to_navigation(value, files, config)) + ) for key, value in data.items() ] elif isinstance(data, list): return [ - _data_to_navigation(item, files, config)[0] - if isinstance(item, dict) and len(item) == 1 - else _data_to_navigation(item, files, config) + ( + _data_to_navigation(item, files, config)[0] + if isinstance(item, dict) and len(item) == 1 + else _data_to_navigation(item, files, config) + ) for item in data ] title, path = data if isinstance(data, tuple) else (None, data) diff --git a/mkdocs/structure/toc.py b/mkdocs/structure/toc.py index 7b4870bc..c2941bfa 100644 --- a/mkdocs/structure/toc.py +++ b/mkdocs/structure/toc.py @@ -5,6 +5,7 @@ generate a list of dicts for each toc item, and then store it as AnchorLinks to maintain compatibility with older versions of MkDocs. """ + from __future__ import annotations from typing import Iterable, Iterator, TypedDict diff --git a/mkdocs/tests/integration.py b/mkdocs/tests/integration.py index a992cac6..9b2ec1fa 100644 --- a/mkdocs/tests/integration.py +++ b/mkdocs/tests/integration.py @@ -14,7 +14,6 @@ - Build documentation other than just MkDocs as it is relatively simple. """ - import logging import os import subprocess diff --git a/mkdocs/utils/__init__.py b/mkdocs/utils/__init__.py index b53d37e2..42caca8e 100644 --- a/mkdocs/utils/__init__.py +++ b/mkdocs/utils/__init__.py @@ -4,6 +4,7 @@ Nothing in this module should have an knowledge of config or the layout and structure of the site and pages in the site. """ + from __future__ import annotations import functools diff --git a/mkdocs/utils/meta.py b/mkdocs/utils/meta.py index aa9e8980..174adb20 100644 --- a/mkdocs/utils/meta.py +++ b/mkdocs/utils/meta.py @@ -32,6 +32,7 @@ Extracts, parses and transforms MultiMarkdown style data from documents. """ + from __future__ import annotations import re diff --git a/pyproject.toml b/pyproject.toml index ec864a75..82b49dde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -218,22 +218,22 @@ skip-string-normalization = true profile = "black" line_length = 100 -[tool.ruff] +[tool.ruff.lint] select = [ "F", "W", "E", "UP", "YTT", "C4", "DTZ", "FA", "ISC", "PIE", "T20", "RSE", "TCH", "B002", "B003", "B005", "B007", "B009", "B012", "B013", "B014", "B015", "B018", "B020", "B021", "B023", "B026", "B033", "B034", "B905", "COM818", "D200", "D201", "D202", "D204", "D207", "D208", "D209", "D210", "D211", "D213", "D214", "D300", "D301", "D400", "D402", "D403", "D405", "D412", "D414", "D415", "D416", "D417", "D419", "PERF101", - "PGH002", "PGH004", "PGH005", + "PGH004", "PGH005", "FLY002", "PLC", "PLE", "PLR0124", "PLR0133", "PLR0206", "PLR0402", "PLR1701", "PLR1722", "PLW0120", "PLW0127", "PLW0129", "PLW0131", "PLW0406", "PLW0602", "PLW0603", "PLW0711", "RUF001", "RUF005", "RUF007", "RUF010", "RUF013", "RUF100", "RUF200", "SIM101", "SIM107", "SIM201", "SIM202", "SIM208", "SIM210", "SIM211", "SIM300", "SIM401", "SIM910", ] -ignore = ["E501", "E731"] +ignore = ["E501", "E731", "PLC0415"] -[tool.ruff.flake8-comprehensions] +[tool.ruff.lint.flake8-comprehensions] allow-dict-calls-with-keyword-arguments = true [tool.mypy]