File tree Expand file tree Collapse file tree 4 files changed +39
-1
lines changed
Misc/NEWS.d/next/Documentation Expand file tree Collapse file tree 4 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 66
66
run : |
67
67
set -Eeuo pipefail
68
68
# Build docs with the nit-picky option; write warnings to file
69
- make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning -- warning-file sphinx-warnings.txt" html
69
+ make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --warning-file sphinx-warnings.txt" html
70
70
- name : ' Check warnings'
71
71
if : github.event_name == 'pull_request'
72
72
run : |
75
75
--fail-if-regression \
76
76
--fail-if-improved \
77
77
--fail-if-new-news-nit
78
+ - name : ' Build EPUB documentation'
79
+ continue-on-error : true
80
+ run : |
81
+ set -Eeuo pipefail
82
+ make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet" epub
83
+ pip install epubcheck
84
+ epubcheck Doc/build/epub/Python.epub &> Doc/epubcheck.txt
85
+ - name : ' Check for fatal errors in EPUB'
86
+ if : github.event_name == 'pull_request'
87
+ continue-on-error : true # until gh-136155 is fixed
88
+ run : |
89
+ python Doc/tools/check-epub.py
78
90
79
91
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
80
92
doctest :
Original file line number Diff line number Diff line change 448
448
449
449
epub_author = 'Python Documentation Authors'
450
450
epub_publisher = 'Python Software Foundation'
451
+ epub_exclude_files = ('index.xhtml' , 'download.xhtml' )
451
452
452
453
# index pages are not valid xhtml
453
454
# https://github.com/sphinx-doc/sphinx/issues/12359
Original file line number Diff line number Diff line change
1
+ import sys
2
+ from pathlib import Path
3
+
4
+
5
+ def main () -> int :
6
+ wrong_directory_msg = "Must run this script from the repo root"
7
+ if not Path ("Doc" ).exists () or not Path ("Doc" ).is_dir ():
8
+ raise RuntimeError (wrong_directory_msg )
9
+
10
+ with Path ("Doc/epubcheck.txt" ).open (encoding = "UTF-8" ) as f :
11
+ messages = [message .split (" - " ) for message in f .read ().splitlines ()]
12
+
13
+ fatal_errors = [message for message in messages if message [0 ] == "FATAL" ]
14
+
15
+ if fatal_errors :
16
+ print ("\n Error: must not contain fatal errors:\n " )
17
+ for error in fatal_errors :
18
+ print (" - " .join (error ))
19
+
20
+ return len (fatal_errors )
21
+
22
+
23
+ if __name__ == "__main__" :
24
+ sys .exit (main ())
Original file line number Diff line number Diff line change
1
+ We are now checking for fatal errors in EPUB builds in CI.
You can’t perform that action at this time.
0 commit comments