Skip to content

Commit 55c4f3c

Browse files
committed
chore: update demo to the latest cookiecutter-robust-python
1 parent d372bb6 commit 55c4f3c

File tree

5 files changed

+26
-11
lines changed

5 files changed

+26
-11
lines changed

.cookiecutter.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"_commit": "4b485513573db074f963642920993ad357792207",
2+
"_commit": "9cc43c6456a28624d29b85487b7f974e8f196397",
33
"_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
44
"add_rust_extension": false,
55
"author": "Kyle Oliver",

.cruft.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
3-
"commit": "4b485513573db074f963642920993ad357792207",
3+
"commit": "9cc43c6456a28624d29b85487b7f974e8f196397",
44
"checkout": null,
55
"context": {
66
"cookiecutter": {
@@ -20,7 +20,7 @@
2020
"license": "MIT",
2121
"development_status": "Development Status :: 1 - Planning",
2222
"_template": "C:\\Users\\56kyl\\source\\repos\\cookiecutter-robust-python",
23-
"_commit": "4b485513573db074f963642920993ad357792207"
23+
"_commit": "9cc43c6456a28624d29b85487b7f974e8f196397"
2424
}
2525
},
2626
"directory": null

noxfile.py

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@
4545
QUALITY: str = "quality"
4646

4747

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-
5448
@nox.session(python=False, name="setup-venv", tags=[ENV])
5549
def setup_venv(session: Session) -> None:
5650
"""Set up the virtual environment for the current project."""
5751
session.run("python", SCRIPTS_FOLDER / "setup-venv.py", REPO_ROOT, "-p", PYTHON_VERSIONS[0], external=True)
5852

5953

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+
6060
@nox.session(python=False, name="setup-remote")
6161
def setup_remote(session: Session) -> None:
6262
"""Set up the remote repository for the current project."""
@@ -156,6 +156,21 @@ def docs_build(session: Session) -> None:
156156
session.log("Building documentation.")
157157
session.run("sphinx-build", "-b", "html", "docs", str(docs_build_dir), "-W")
158158

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+
159174

160175
@nox.session(python=False, name="build-python", tags=[BUILD])
161176
def build_python(session: Session) -> None:

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ docs = [
4040
"furo>=2024.8.6",
4141
"myst-parser>=3.0.1",
4242
"sphinx>=7.4.7",
43+
"sphinx-autobuild>=2024.10.3",
4344
"sphinx-autodoc-typehints>=2.3.0",
4445
"sphinx-copybutton>=0.5.2",
4546
"sphinx-tabs>=3.4.7",

scripts/setup-git.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ def setup_git(path: Path) -> None:
2323
commands: list[list[str]] = [
2424
["git", "init"],
2525
["git", "branch", "-m", "master", "main"],
26-
["git", "checkout", "main"],
27-
["git", "checkout", "-b", "develop", "main"],
2826
["git", "add", "."],
2927
["git", "commit", "-m", "feat: initial commit"],
28+
["git", "checkout", "-b", "develop", "main"],
3029
]
3130
check_dependencies(path=path, dependencies=["git"])
3231

0 commit comments

Comments
 (0)