forked from 2i2c-org/infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
28 lines (19 loc) · 780 Bytes
/
noxfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import nox
nox.options.reuse_existing_virtualenvs = True
BUILD_COMMAND = ["-b", "html", "docs", "docs/_build/html"]
def install_deps(session):
# Manually installing this because conda is a bit wonky w/ nox
session.conda_install("--channel=conda-forge", "go-terraform-docs", "python=3.8")
session.install("-r", "docs/requirements.txt")
@nox.session(venv_backend="conda")
def docs(session):
install_deps(session)
session.run("sphinx-build", *BUILD_COMMAND)
@nox.session(name="docs-live", venv_backend="conda")
def docs_live(session):
install_deps(session)
cmd = ["sphinx-autobuild"]
for path in ["*/_build/*", "*/tmp/*", "*/reference/terraform.md"]:
cmd.extend(["--ignore", path])
cmd.extend(BUILD_COMMAND)
session.run(*cmd)