Skip to content

Commit 058d63c

Browse files
authored
docs: fix docs build (#670)
* docs: fix docs build * remove unused
1 parent 6a39adf commit 058d63c

File tree

3 files changed

+10
-23
lines changed

3 files changed

+10
-23
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ repos:
1010
- id: validate-pyproject
1111

1212
- repo: https://github.com/crate-ci/typos
13-
rev: typos-dict-v0.11.27
13+
rev: v1.24.5
1414
hooks:
1515
- id: typos
1616

1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.6.3
18+
rev: v0.6.4
1919
hooks:
2020
- id: ruff
2121
args: ["--fix"]

docs/scripts/_hooks.py

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
import types
99
import typing
1010
import warnings
11-
from contextlib import contextmanager
1211
from importlib import import_module
1312
from importlib.machinery import ModuleSpec
1413
from itertools import count
1514
from textwrap import dedent
1615
from typing import TYPE_CHECKING, Any, Mapping
1716

18-
from griffe.dataclasses import Alias
19-
from griffe.docstrings import numpy
17+
from griffe import Alias
2018
from mkdocstrings_handlers.python.handler import PythonHandler
2119

2220
from magicgui.type_map import get_widget_class
@@ -27,17 +25,6 @@
2725
from mkdocs.structure.pages import Page
2826

2927

30-
# TODO: figure out how to do this with options
31-
@contextmanager
32-
def _hide_numpy_warn():
33-
if not hasattr(numpy, "_warn"):
34-
yield
35-
return
36-
before, numpy._warn = numpy._warn, lambda *x, **k: None
37-
yield
38-
numpy._warn = before
39-
40-
4128
def inject_dynamic_docstring(item: Alias, identifier: str) -> None:
4229
for i in range(1, 3):
4330
module_name, *names = identifier.rsplit(".", 1)
@@ -67,12 +54,11 @@ def collect(self, identifier: str, config: Mapping[str, Any]) -> Any:
6754
return item
6855

6956
def render(self, data: Any, config: Mapping[str, Any]) -> str:
70-
with _hide_numpy_warn():
71-
return super().render(data, config)
57+
return super().render(data, config)
7258

7359

7460
class MyLoader(importlib.abc.Loader):
75-
def create_module(self, spec):
61+
def create_module(self, spec) -> types.ModuleType:
7662
return types.ModuleType(spec.name)
7763

7864
def exec_module(self, module: types.ModuleType) -> None:

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,16 @@ dev = [
8585
docs = [
8686
"mkdocs",
8787
"mkdocs-material ~=9.5",
88-
"mkdocstrings ==0.25.1",
89-
"mkdocstrings-python ==1.10.5",
88+
"mkdocstrings ==0.26.1",
89+
"mkdocstrings-python ==1.11.1",
90+
"griffe ==1.2.0",
9091
"mkdocs-gen-files ==0.5.0",
9192
"mkdocs-literate-nav ==0.6.1",
9293
"mkdocs-spellcheck[all]",
93-
"mkdocs-gallery ==0.10.1",
94+
"mkdocs-gallery ==0.10.3",
9495
"qtgallery ==0.0.2",
9596
# extras for all the widgets
96-
"napari ==0.5.0",
97+
"napari ==0.5.3",
9798
"pyqt6",
9899
"pint",
99100
"matplotlib",

0 commit comments

Comments
 (0)