Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b8fb6a4

Browse files
authoredApr 11, 2025··
Merge branch 'main' into skipped
2 parents 75944aa + 77a363b commit b8fb6a4

File tree

4 files changed

+76
-86
lines changed

4 files changed

+76
-86
lines changed
 

Diff for: ‎.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: trailing-whitespace
1515

1616
- repo: https://github.com/astral-sh/ruff-pre-commit
17-
rev: v0.9.6
17+
rev: v0.11.5
1818
hooks:
1919
- id: ruff-format
2020

Diff for: ‎.ruff.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
target-version = "py313" # Pin Ruff to Python 3.13
2+
line-length = 88
3+
output-format = "full"
4+
5+
[format]
6+
preview = true
7+
docstring-code-format = true

Diff for: ‎build_docs.py

+64-79
Original file line numberDiff line numberDiff line change
@@ -610,14 +610,12 @@ def build(self):
610610
sphinxopts = list(self.language.sphinxopts)
611611
if self.language.tag != "en":
612612
locale_dirs = self.build_root / self.version.name / "locale"
613-
sphinxopts.extend(
614-
(
615-
f"-D locale_dirs={locale_dirs}",
616-
f"-D language={self.language.iso639_tag}",
617-
"-D gettext_compact=0",
618-
"-D translation_progress_classes=1",
619-
)
620-
)
613+
sphinxopts.extend((
614+
f"-D locale_dirs={locale_dirs}",
615+
f"-D language={self.language.iso639_tag}",
616+
"-D gettext_compact=0",
617+
"-D translation_progress_classes=1",
618+
))
621619
if self.language.tag == "ja":
622620
# Since luatex doesn't support \ufffd, replace \ufffd with '?'.
623621
# https://gist.github.com/zr-tex8r/e0931df922f38fbb67634f05dfdaf66b
@@ -669,20 +667,18 @@ def build(self):
669667
self.version,
670668
self.checkout / "Doc" / "tools" / "templates" / "indexsidebar.html",
671669
)
672-
run_with_logging(
673-
[
674-
"make",
675-
"-C",
676-
self.checkout / "Doc",
677-
"PYTHON=" + str(python),
678-
"SPHINXBUILD=" + str(sphinxbuild),
679-
"BLURB=" + str(blurb),
680-
"VENVDIR=" + str(self.venv),
681-
"SPHINXOPTS=" + " ".join(sphinxopts),
682-
"SPHINXERRORHANDLING=",
683-
maketarget,
684-
]
685-
)
670+
run_with_logging([
671+
"make",
672+
"-C",
673+
self.checkout / "Doc",
674+
"PYTHON=" + str(python),
675+
"SPHINXBUILD=" + str(sphinxbuild),
676+
"BLURB=" + str(blurb),
677+
"VENVDIR=" + str(self.venv),
678+
"SPHINXOPTS=" + " ".join(sphinxopts),
679+
"SPHINXERRORHANDLING=",
680+
maketarget,
681+
])
686682
run(["mkdir", "-p", self.log_directory])
687683
run(["chgrp", "-R", self.group, self.log_directory])
688684
if self.includes_html:
@@ -745,69 +741,57 @@ def copy_build_to_webroot(self, http: urllib3.PoolManager) -> None:
745741
# Copy built HTML files to webroot (default /srv/docs.python.org)
746742
changed = changed_files(self.checkout / "Doc" / "build" / "html", target)
747743
logging.info("Copying HTML files to %s", target)
748-
run(
749-
[
750-
"chown",
751-
"-R",
752-
":" + self.group,
753-
self.checkout / "Doc" / "build" / "html/",
754-
]
755-
)
744+
run([
745+
"chown",
746+
"-R",
747+
":" + self.group,
748+
self.checkout / "Doc" / "build" / "html/",
749+
])
756750
run(["chmod", "-R", "o+r", self.checkout / "Doc" / "build" / "html"])
757-
run(
758-
[
759-
"find",
760-
self.checkout / "Doc" / "build" / "html",
761-
"-type",
762-
"d",
763-
"-exec",
764-
"chmod",
765-
"o+x",
766-
"{}",
767-
";",
768-
]
769-
)
770-
run(
771-
[
772-
"rsync",
773-
"-a",
774-
"--delete-delay",
775-
"--filter",
776-
"P archives/",
777-
str(self.checkout / "Doc" / "build" / "html") + "/",
778-
target,
779-
]
780-
)
751+
run([
752+
"find",
753+
self.checkout / "Doc" / "build" / "html",
754+
"-type",
755+
"d",
756+
"-exec",
757+
"chmod",
758+
"o+x",
759+
"{}",
760+
";",
761+
])
762+
run([
763+
"rsync",
764+
"-a",
765+
"--delete-delay",
766+
"--filter",
767+
"P archives/",
768+
str(self.checkout / "Doc" / "build" / "html") + "/",
769+
target,
770+
])
781771

782772
if not self.quick:
783773
# Copy archive files to /archives/
784774
logging.debug("Copying dist files.")
785-
run(
786-
[
787-
"chown",
788-
"-R",
789-
":" + self.group,
790-
self.checkout / "Doc" / "dist",
791-
]
792-
)
793-
run(
794-
[
795-
"chmod",
796-
"-R",
797-
"o+r",
798-
self.checkout / "Doc" / "dist",
799-
]
800-
)
775+
run([
776+
"chown",
777+
"-R",
778+
":" + self.group,
779+
self.checkout / "Doc" / "dist",
780+
])
781+
run([
782+
"chmod",
783+
"-R",
784+
"o+r",
785+
self.checkout / "Doc" / "dist",
786+
])
801787
run(["mkdir", "-m", "o+rx", "-p", target / "archives"])
802788
run(["chown", ":" + self.group, target / "archives"])
803-
run(
804-
[
805-
"cp",
806-
"-a",
807-
*(self.checkout / "Doc" / "dist").glob("*"),
808-
target / "archives",
809-
]
810-
)
789+
run([
790+
"cp",
791+
"-a",
792+
*(self.checkout / "Doc" / "dist").glob("*"),
793+
target / "archives",
794+
])
811795
changed.append("archives/")
812796
for file in (target / "archives").iterdir():
813797
changed.append("archives/" + file.name)
@@ -986,7 +970,8 @@ def parse_args():
986970
default=Path("/var/log/docsbuild/"),
987971
)
988972
parser.add_argument(
989-
"--languages", "--language",
973+
"--languages",
974+
"--language",
990975
nargs="*",
991976
help="Language translation, as a PEP 545 language tag like"
992977
" 'fr' or 'pt-br'. "

Diff for: ‎check_versions.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,10 @@ async def which_sphinx_is_used_in_production():
111111
table = [
112112
[
113113
version.name,
114-
*await asyncio.gather(
115-
*[
116-
get_version_in_prod(language.tag, version.name)
117-
for language in LANGUAGES
118-
]
119-
),
114+
*await asyncio.gather(*[
115+
get_version_in_prod(language.tag, version.name)
116+
for language in LANGUAGES
117+
]),
120118
]
121119
for version in VERSIONS
122120
]

0 commit comments

Comments
 (0)
Please sign in to comment.