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
BuildDoc: link verbosity to distutils' #5090
Conversation
This preserves the current behavior (using 0), but picks up distutils' `-v` and `-q` options.
@@ -105,7 +105,8 @@ def initialize_options(self): | |||
self.config_dir = None # type: unicode | |||
self.link_index = False | |||
self.copyright = '' | |||
self.verbosity = 0 | |||
# Link verbosity to distutils' (which uses 1 by default). | |||
self.verbosity = self.distribution.verbose - 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.
Are self.distribution
and self.distribution.verbose
public API? It seems there are no document for them.
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.
It seems distlib provides Command.distribution
and Distribution.verbose
since py27 (I just checked in GitHub).
https://github.com/python/cpython/blob/master/Lib/distutils/cmd.py#L61
https://github.com/python/cpython/blob/3.5/Lib/distutils/dist.py#L134
Unfortunately they are not documented. But I suppose it's okay.
https://docs.python.org/3/distutils/apiref.html
@@ -105,7 +105,8 @@ def initialize_options(self): | |||
self.config_dir = None # type: unicode | |||
self.link_index = False | |||
self.copyright = '' | |||
self.verbosity = 0 | |||
# Link verbosity to distutils' (which uses 1 by default). | |||
self.verbosity = self.distribution.verbose - 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.
mypy warns this line as following. Could you check this please?:
sphinx/setup_command.py:109:26: error: "BuildDoc" has no attribute "distribution"
https://travis-ci.org/sphinx-doc/sphinx/jobs/391888857#L493
Just merged (via #8001). Thank you for your contribution! |
This preserves the current behavior (using 0), but picks up distutils'
-v
and
-q
options.