|
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.""" |
@@ -156,6 +156,21 @@ def docs_build(session: Session) -> None: |
156 | 156 | session.log("Building documentation.") |
157 | 157 | session.run("sphinx-build", "-b", "html", "docs", str(docs_build_dir), "-W") |
158 | 158 |
|
| 159 | +@nox.session(python=DEFAULT_PYTHON_VERSION, name="docs", tags=[DOCS, BUILD]) |
| 160 | +def docs(session: Session) -> None: |
| 161 | + """Build and serve the project documentation (Sphinx).""" |
| 162 | + session.log("Installing documentation dependencies...") |
| 163 | + session.install("-e", ".", "--group", "docs") |
| 164 | + |
| 165 | + session.log(f"Building documentation with py{session.python}.") |
| 166 | + docs_build_dir = Path("docs") / "_build" / "html" |
| 167 | + |
| 168 | + session.log(f"Cleaning build directory: {docs_build_dir}") |
| 169 | + session.run("sphinx-build", "-b", "html", "docs", str(docs_build_dir), "-E") |
| 170 | + |
| 171 | + session.log("Building and serving documentation.") |
| 172 | + session.run("sphinx-autobuild", "--open-browser", "docs", str(docs_build_dir)) |
| 173 | + |
159 | 174 |
|
160 | 175 | @nox.session(python=False, name="build-python", tags=[BUILD]) |
161 | 176 | def build_python(session: Session) -> None: |
|
0 commit comments