Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Jun 13, 2018

This preserves the current behavior (using 0), but picks up distutils' -v
and -q options.

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
Copy link
Member

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.

Copy link
Member

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
Copy link
Member

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

@tk0miya tk0miya added the type:proposal a feature suggestion label Jul 24, 2020
@tk0miya tk0miya added this to the 3.2.0 milestone Jul 24, 2020
tk0miya added a commit to tk0miya/sphinx that referenced this pull request Jul 24, 2020
@tk0miya
Copy link
Member

tk0miya commented Jul 24, 2020

Just merged (via #8001). Thank you for your contribution!

@tk0miya tk0miya closed this Jul 24, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type:proposal a feature suggestion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants