|
45 | 45 | QUALITY: str = "quality" |
46 | 46 |
|
47 | 47 |
|
48 | | -@nox.session(python=False, name="setup-git", tags=[ENV]) |
49 | | -def setup_git(session: Session) -> None: |
50 | | - """Set up the git repo for the current project.""" |
51 | | - session.run("python", SCRIPTS_FOLDER / "setup-git.py", REPO_ROOT, external=True) |
52 | | - |
53 | | - |
54 | 48 | @nox.session(python=False, name="setup-venv", tags=[ENV]) |
55 | 49 | def setup_venv(session: Session) -> None: |
56 | 50 | """Set up the virtual environment for the current project.""" |
57 | 51 | session.run("python", SCRIPTS_FOLDER / "setup-venv.py", REPO_ROOT, "-p", PYTHON_VERSIONS[0], external=True) |
58 | 52 |
|
59 | 53 |
|
| 54 | +@nox.session(python=False, name="setup-git", tags=[ENV]) |
| 55 | +def setup_git(session: Session) -> None: |
| 56 | + """Set up the git repo for the current project.""" |
| 57 | + session.run("python", SCRIPTS_FOLDER / "setup-git.py", REPO_ROOT, external=True) |
| 58 | + |
| 59 | + |
60 | 60 | @nox.session(python=False, name="setup-remote") |
61 | 61 | def setup_remote(session: Session) -> None: |
62 | 62 | """Set up the remote repository for the current project.""" |
@@ -191,6 +191,21 @@ def docs_build(session: Session) -> None: |
191 | 191 | session.log("Building documentation.") |
192 | 192 | session.run("sphinx-build", "-b", "html", "docs", str(docs_build_dir), "-W") |
193 | 193 |
|
| 194 | +@nox.session(python=DEFAULT_PYTHON_VERSION, name="docs", tags=[DOCS, BUILD]) |
| 195 | +def docs(session: Session) -> None: |
| 196 | + """Build and serve the project documentation (Sphinx).""" |
| 197 | + session.log("Installing documentation dependencies...") |
| 198 | + session.install("-e", ".", "--group", "docs") |
| 199 | + |
| 200 | + session.log(f"Building documentation with py{session.python}.") |
| 201 | + docs_build_dir = Path("docs") / "_build" / "html" |
| 202 | + |
| 203 | + session.log(f"Cleaning build directory: {docs_build_dir}") |
| 204 | + session.run("sphinx-build", "-b", "html", "docs", str(docs_build_dir), "-E") |
| 205 | + |
| 206 | + session.log("Building and serving documentation.") |
| 207 | + session.run("sphinx-autobuild", "--open-browser", "docs", str(docs_build_dir)) |
| 208 | + |
194 | 209 |
|
195 | 210 | @nox.session(python=False, name="build-python", tags=[BUILD]) |
196 | 211 | def build_python(session: Session) -> None: |
|
0 commit comments