Skip to content

Doc: -W flag for sphinx-build can be disabled #10303

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

Merged
merged 5 commits into from
Nov 3, 2018

Conversation

JulienPalard
Copy link
Member

Since 859c068, travis-ci is using -W via SPHINXOPTS so
we do not need it unconditionally in ALLSPHINXOPTS.

So I'm adding -W to Azure CI and droping it from ALLSPHINXOPTS.

Making -W optional would help with i18n builds (some versions, like
dev, are not actively maintained by translators, and can easily error, some countries are also less strict on sphinx errors and yields tons of thems).

cc @matrixise, @tirkarthi

Since 859c068, CI is enforcing -W so
we do not need it unconditionally in Doc/Makefile.

Making -W optional would help with i18n builds (some versions, like
dev, are not actively maintained by translators, and can easily error).
@tirkarthi
Copy link
Member

The reason over the change was to catch warnings as errors locally. If it's caught during CI I am okay. It's just that it causes a round trip where make docs passes locally and fails in CI but helps for translated builds.

I have added a NEWS entry in my previous PR which can be deleted as part of this PR?

https://devguide.python.org/committing/#what-s-new-and-news-entries

If a change is reverted prior to release, then the corresponding entry is simply removed. Otherwise, a new entry must be added noting that the change has been reverted (e.g. when a feature is released in an alpha and then cut prior to the first beta).

Ref : https://github.com/python/cpython/pull/8248/files#diff-07576315d4856b4c89dcc90f4a2704e2

Copy link
Member

@tirkarthi tirkarthi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving the changes. News entry can be deleted to avoid confusion. Thanks :)

https://github.com/python/cpython/pull/8248/files#diff-07576315d4856b4c89dcc90f4a2704e2

@JulienPalard JulienPalard changed the title Doc: Make -W (warn as error) more optional, still enforced by CI. Doc: -W flag for sphinx-build can be disabled Nov 3, 2018
@JulienPalard
Copy link
Member Author

Implemented nice idea from @matrixise, @tirkarthi what do you think?

@tirkarthi
Copy link
Member

@JulienPalard I am little confused here since my Makefile knowledge is low but isn't it the same as using -W directly and we now just use SPHINXERRORHANDLING that refers to -W? Users who want to disable this set SPHINXERRORHANDLING environment variable to ''?

@JulienPalard
Copy link
Member Author

JulienPalard commented Nov 3, 2018

Users who want to disable this set SPHINXERRORHANDLING environment variable to ''?

Almost, the precedence in Makefile is "command line beats makefile variables beats environment", so we'll have to pass it as command line, like:

make html SPHINXERRORHANDLING=''

Which is nice as we could also pass:

make html SPHINXERRORHANDLING='-W --keep-going'

in the CI to get more than a single error in the report.

@tirkarthi
Copy link
Member

@JulienPalard Thanks for the explanation. LGTM 👍

@matrixise
Copy link
Member

LGTM for me! You can merge it.

@JulienPalard JulienPalard merged commit f98c162 into python:master Nov 3, 2018
@JulienPalard JulienPalard deleted the doc-warn-optionally branch June 16, 2019 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants