-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
GH-136155: Fail the EPUB check on fatal errors #137351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The original PR had these as parallel jobs, but I asked to keep them in the same one because they have a lot of duplicate setup config :) |
True, though the setup for epub alone is far simpler & easier to comprehend. I think splitting is useful, without doing so the docs job takes ~2 minutes longer, which delays feedback if the PR is good to leave as-is. It's rare for doctest to fail & docs to pass. A |
CPYTHON_ROOT = Path( | ||
__file__, # cpython/Doc/tools/check-epub.py | ||
'..', # cpython/Doc/tools | ||
'..', # cpython/Doc | ||
'..', # cpython | ||
).resolve() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CPYTHON_ROOT = Path( | |
__file__, # cpython/Doc/tools/check-epub.py | |
'..', # cpython/Doc/tools | |
'..', # cpython/Doc | |
'..', # cpython | |
).resolve() | |
CPYTHON_ROOT = Path(__file__).parents[2] # cpython/Doc/tools/check-epub.py -> cpython/ |
fatal_errors = [message for message in messages if message[0] == "FATAL"] | ||
def main() -> int: | ||
lines = EPUBCHECK_PATH.read_text(encoding='utf-8').splitlines() | ||
fatal_errors = [line for line in lines if line.startswith('FATAL')] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errors = [line for line in lines if line.startswith('ERROR')] | |
if errors: | |
print() | |
print(f'Warning: epubcheck reported {len(errors)} error(s):') | |
print() | |
print('\n'.join(errors)) | |
Could we start to display errors as warnings for informational purposes?
for error in fatal_errors: | ||
print(" - ".join(error)) | ||
err_count = len(fatal_errors) | ||
s = 's' * (err_count != 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s = 's' * (err_count != 1) | |
s = 's' if err_count > 1 else '' |
nit-picky: for readability/verbosity
We also split
epub
to a parallel job.A
📚 Documentation preview 📚: https://cpython-previews--137351.org.readthedocs.build/