Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,15 @@ updates:
prefix: ⬆️
schedule:
interval: monthly
groups:
actions:
patterns: ["*"]
- package-ecosystem: pip
directory: /
commit-message:
prefix: ⬆️
schedule:
interval: monthly
groups:
python-deps:
patterns: ["*"]
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ repos:
rev: v2.1.0
hooks:
- id: mypy
additional_dependencies: []
# install sphinx so the hook type-checks with real types,
# matching the tox mypy environment (which installs the package)
additional_dependencies: [sphinx]

- repo: local
hooks:
Expand Down
17 changes: 9 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Homepage = "https://github.com/executablebooks/sphinx-design"
Documentation = "https://sphinx-design.readthedocs.io"

[project.optional-dependencies]
code-style = ["pre-commit>=3,<4"]
code-style = ["pre-commit>=3,<5"]
rtd = ["myst-parser>=4,<6"]
testing = [
"myst-parser>=4,<6",
Expand All @@ -50,15 +50,16 @@ testing-no-myst = [
"defusedxml",
]

theme-furo = ["furo~=2024.7.18"]
theme-pydata = ["pydata-sphinx-theme~=0.15.2"]
theme-rtd = ["sphinx-rtd-theme~=2.0"]
theme-sbt = ["sphinx-book-theme~=1.1"]
theme-im = ["sphinx-immaterial~=0.12.2"]
theme-furo = ["furo~=2025.12"]
theme-pydata = ["pydata-sphinx-theme~=0.20.0"]
theme-rtd = ["sphinx-rtd-theme~=3.1"]
theme-sbt = ["sphinx-book-theme~=1.2"]
theme-im = ["sphinx-immaterial~=0.13.9"]

[dependency-groups]
mypy = ["mypy==1.19.1"]
ruff = ["ruff==0.14.11"]
# keep in sync with the mirrors-mypy / ruff-pre-commit revs in .pre-commit-config.yaml
mypy = ["mypy==2.1.0"]
ruff = ["ruff==0.15.20"]

[tool.flit.sdist]
exclude = [
Expand Down
4 changes: 3 additions & 1 deletion sphinx_design/dropdown.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Originally Adapted from sphinxcontrib.details.directive"""

from typing import Any

from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.application import Sphinx
Expand Down Expand Up @@ -148,7 +150,7 @@ class DropdownHtmlTransform(SphinxPostTransform):
default_priority = 199
formats = ("html",)

def run(self) -> None:
def run(self, **kwargs: Any) -> None:
"""Run the transform"""
document: nodes.document = self.document
for node in findall(document)(lambda node: is_component(node, "dropdown")):
Expand Down
10 changes: 5 additions & 5 deletions sphinx_design/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ def _add_directive(name, directive, **kwargs):
directive_map[name] = directive
add_directive(name, directive, **kwargs)

app.add_directive = _add_directive
app.add_directive = _add_directive # type: ignore[assignment,method-assign]
yield directive_map
app.add_directive = add_directive
app.add_directive = add_directive # type: ignore[method-assign]


def update_css_js(app: Sphinx):
"""Copy the CSS to the build directory."""
# reset changed identifier
app.env.sphinx_design_css_changed = False
app.env.sphinx_design_css_changed = False # type: ignore[attr-defined]
# setup up new static path in output dir
static_path = (Path(app.outdir) / "_sphinx_design_static").absolute()
static_existed = static_path.exists()
Expand All @@ -105,15 +105,15 @@ def update_css_js(app: Sphinx):
if css_path.exists():
return
if static_existed:
app.env.sphinx_design_css_changed = True
app.env.sphinx_design_css_changed = True # type: ignore[attr-defined]
for path in static_path.glob("*.css"):
path.unlink()
css_path.write_text(content, encoding="utf8")


def update_css_links(app: Sphinx, env: BuildEnvironment):
"""If CSS has changed, all files must be re-written, to include the correct stylesheets."""
if env.sphinx_design_css_changed:
if env.sphinx_design_css_changed: # type: ignore[attr-defined]
return list(env.all_docs.keys())


Expand Down
4 changes: 3 additions & 1 deletion sphinx_design/tabs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from typing import Any

from docutils import nodes
from docutils.parsers.rst import directives
from sphinx.application import Sphinx
Expand Down Expand Up @@ -215,7 +217,7 @@ class TabSetHtmlTransform(SphinxPostTransform):
default_priority = 200
formats = ("html",)

def run(self) -> None:
def run(self, **kwargs: Any) -> None:
"""Run the transform."""

# setup id generators
Expand Down
Loading