Skip to content

Commit b2814df

Browse files
euri10cofin
authored andcommitted
lint
1 parent d5dad6d commit b2814df

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

docs/_ext/playground.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
import logging
44
from pathlib import Path
5+
from typing import Any
56
from uuid import uuid4
67

78
from docutils import nodes
89
from docutils.parsers.rst import Directive
910
from jinja2 import Environment, FileSystemLoader
11+
from typing_extensions import Self
12+
13+
__all__ = ("WasmPlayground", "setup", )
14+
1015

1116
logger = logging.getLogger(__name__)
1217

@@ -19,7 +24,7 @@ class WasmPlayground(Directive):
1924
logger.info("Initializing WasmPlayground directive")
2025
has_content = True
2126

22-
def run(self):
27+
def run(self: Self) -> list[Any]:
2328
# Generate unique IDs for the HTML elements
2429
id = uuid4().hex
2530
env = Environment(loader=FileSystemLoader(Path(__file__).parent))
@@ -28,15 +33,10 @@ def run(self):
2833
return [nodes.raw(text=rendered, format="html")]
2934

3035

31-
def setup(app):
36+
def setup(app: Any) -> dict[str, Any]:
3237
"""
3338
Register the directive with Sphinx.
3439
"""
3540
app.add_js_file("https://cdn.jsdelivr.net/pyodide/v0.29.0/full/pyodide.js", priority=100)
3641
app.add_directive("wasm-playground", WasmPlayground)
37-
return {
38-
"version": "1.0",
39-
"parallel_read_safe": True,
40-
"parallel_write_safe": True,
41-
}
42-
42+
return {"version": "1.0", "parallel_read_safe": True, "parallel_write_safe": True}

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"sphinx_togglebutton",
6262
"sphinx_paramlinks",
6363
"sphinxcontrib.mermaid",
64-
"docs._ext.playground"
64+
"docs._ext.playground",
6565
]
6666
intersphinx_mapping = {
6767
"python": ("https://docs.python.org/3", None),

0 commit comments

Comments
 (0)