-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
44 lines (37 loc) · 1.07 KB
/
noxfile.py
File metadata and controls
44 lines (37 loc) · 1.07 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import nox
# Speed up builds by uv and reusing virtualenvs
nox.options.reuse_existing_virtualenvs = True
nox.options.default_venv_backend = "uv"
@nox.session
@nox.parametrize("language", ["cs", "uk"])
def gettext(session, language):
"""Generate .pot files and update .po files."""
session.install("sphinx==8.1.3", "sphinx-intl==2.3.2")
# Generate .pot files from Sphinx
session.run("sphinx-build", "-b", "gettext", "source", "build/gettext")
# Update .po from .pot templates
session.run(
"sphinx-intl",
"update", # update .po files
"-p", # from .pot files at
"build/gettext",
"-l", # for language
language,
# No line wrapping
"-w",
"0",
)
@nox.session
@nox.parametrize("language", ["en", "cs", "uk"])
def build(session, language):
"""Build documentation for a language."""
session.install("sphinx==8.1.3")
session.run(
"sphinx-build",
"-b",
"html",
"-D",
f"language={language}",
"source",
f"build/{language}",
)