Skip to content

Commit 22771e6

Browse files
authored
Merge pull request #155 from Carreau/mypy
Minor refactor + typing info
2 parents f2c4bb2 + ba36707 commit 22771e6

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

jupyterlite_sphinx/jupyterlite_sphinx.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
import shutil
55
import glob
66
import re
7+
from typing import Dict, Any
78

89
from pathlib import Path
910

1011
from urllib.parse import quote
1112

1213
import subprocess
14+
from subprocess import CompletedProcess
1315

1416
from docutils.parsers.rst import directives
1517
from docutils.nodes import SkipNode, Element
@@ -616,12 +618,14 @@ def jupyterlite_build(app: Sphinx, error):
616618
[isinstance(s, str) for s in command]
617619
), f"Expected all commands arguments to be a str, got {command}"
618620

619-
kwargs = {"cwd": app.srcdir, "check": False}
621+
kwargs: Dict[str, Any] = {}
620622
if app.env.config.jupyterlite_silence:
621623
kwargs["stdout"] = subprocess.PIPE
622624
kwargs["stderr"] = subprocess.PIPE
623625

624-
completed_process = subprocess.run(command, **kwargs)
626+
completed_process: CompletedProcess[bytes] = subprocess.run(
627+
command, cwd=app.srcdir, check=True, **kwargs
628+
)
625629

626630
if completed_process.returncode != 0:
627631
if app.env.config.jupyterlite_silence:

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,9 @@ features = ["docs"]
4545
[tool.hatch.envs.docs.scripts]
4646
build = "sphinx-build -W -b html docs docs/build/html"
4747
serve = "python -m http.server --directory docs/build/html"
48+
49+
[[tool.mypy.overrides]]
50+
module = [
51+
"voici",
52+
]
53+
ignore_missing_imports = true

0 commit comments

Comments
 (0)