Skip to content

Commit 237db85

Browse files
authored
Merge branch 'main' into indexsidebar
2 parents af76e95 + 1e856ea commit 237db85

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ jobs:
4141
4242
unit:
4343
name: Unit tests
44-
runs-on: ubuntu-latest
44+
runs-on: ${{ matrix.os }}
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
python-version:
49-
- "3.13"
50-
- "3.14"
48+
python-version: ["3.13", "3.14"]
49+
os: [windows-latest, macos-latest, ubuntu-latest]
5150

5251
steps:
5352
- uses: actions/checkout@v4
@@ -69,5 +68,6 @@ jobs:
6968
- name: Upload coverage
7069
uses: codecov/codecov-action@v5
7170
with:
71+
flags: ${{ matrix.os }}
7272
name: Python ${{ matrix.python-version }}
7373
token: ${{ secrets.CODECOV_ORG_TOKEN }}

build_docs.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def setup_switchers(script_content: bytes, html_root: Path) -> None:
463463
- Cross-link various versions in a version switcher
464464
"""
465465
switchers_path = html_root / "_static" / "switchers.js"
466-
switchers_path.write_text(script_content, encoding="UTF-8")
466+
switchers_path.write_bytes(script_content)
467467

468468
for file in html_root.glob("**/*.html"):
469469
depth = len(file.relative_to(html_root).parts) - 1
@@ -910,20 +910,21 @@ def _checkout_name(select_output: str | None) -> str:
910910
return "cpython"
911911

912912

913-
def main() -> None:
913+
def main() -> int:
914914
"""Script entry point."""
915915
args = parse_args()
916916
setup_logging(args.log_directory, args.select_output)
917917
load_environment_variables()
918918

919919
if args.select_output is None:
920-
build_docs_with_lock(args, "build_docs.lock")
921-
elif args.select_output == "no-html":
922-
build_docs_with_lock(args, "build_docs_archives.lock")
923-
elif args.select_output == "only-html":
924-
build_docs_with_lock(args, "build_docs_html.lock")
925-
elif args.select_output == "only-html-en":
926-
build_docs_with_lock(args, "build_docs_html_en.lock")
920+
return build_docs_with_lock(args, "build_docs.lock")
921+
if args.select_output == "no-html":
922+
return build_docs_with_lock(args, "build_docs_archives.lock")
923+
if args.select_output == "only-html":
924+
return build_docs_with_lock(args, "build_docs_html.lock")
925+
if args.select_output == "only-html-en":
926+
return build_docs_with_lock(args, "build_docs_html_en.lock")
927+
return EX_FAILURE
927928

928929

929930
def parse_args() -> argparse.Namespace:
@@ -1072,12 +1073,12 @@ def build_docs_with_lock(args: argparse.Namespace, lockfile_name: str) -> int:
10721073
return EX_FAILURE
10731074

10741075
try:
1075-
return EX_OK if build_docs(args) else EX_FAILURE
1076+
return build_docs(args)
10761077
finally:
10771078
lock.close()
10781079

10791080

1080-
def build_docs(args: argparse.Namespace) -> bool:
1081+
def build_docs(args: argparse.Namespace) -> int:
10811082
"""Build all docs (each language and each version)."""
10821083
logging.info("Full build start.")
10831084
start_time = perf_counter()
@@ -1160,7 +1161,7 @@ def build_docs(args: argparse.Namespace) -> bool:
11601161

11611162
logging.info("Full build done (%s).", format_seconds(perf_counter() - start_time))
11621163

1163-
return any_build_failed
1164+
return EX_FAILURE if any_build_failed else EX_OK
11641165

11651166

11661167
def parse_versions_from_devguide(http: urllib3.PoolManager) -> Versions:
@@ -1404,4 +1405,4 @@ def purge_surrogate_key(http: urllib3.PoolManager, surrogate_key: str) -> None:
14041405

14051406

14061407
if __name__ == "__main__":
1407-
sys.exit(main())
1408+
raise SystemExit(main())

0 commit comments

Comments
 (0)