Skip to content

Commit

Permalink
Build docs in nitpick
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jan 2, 2024
1 parent 5112695 commit 037f5a5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
"https://github.com/hynek/.*/compare/.*",
]

nitpick_ignore = [
("py:class", "environ._environ_config.T"),
("py:class", "environ._environ_config.Sentinel"),
]

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
19 changes: 19 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,24 @@ def mypy(session: nox.Session) -> None:

@nox.session(python=DOCS_PYTHON)
def docs(session: nox.Session) -> None:
if session.posargs and session.posargs[0] == "watch":
session.install("-e", ".[docs]", "watchfiles")
session.run(
"watchfiles",
"--ignore-paths",
"docs/_build",
"python -Im sphinx "
"-T -E "
"-W --keep-going "
"-b html "
"-d docs/_build/doctrees "
"-D language=en "
"-n "
"docs "
"docs/_build/html",
)
return

session.install(".[docs]")

for cmd in ["html", "doctest"]:
Expand All @@ -139,6 +157,7 @@ def docs(session: nox.Session) -> None:
"-b", cmd,
"-d", "docs/_build/doctrees",
"-D", "language=en",
"-n",
"docs",
"docs/_build/html",
# fmt: on
Expand Down

0 comments on commit 037f5a5

Please sign in to comment.