From d3f0af81c236cd5e857dd1b5fd524d5dfaf4c7fb Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sun, 10 Jun 2018 19:07:54 -0700 Subject: [PATCH 1/7] blacken python files --- conf.py | 92 ++++++++++++++------------ tools/rstlint.py | 163 +++++++++++++++++++++++++++++++++++++---------- tools/serve.py | 1 - 3 files changed, 179 insertions(+), 77 deletions(-) diff --git a/conf.py b/conf.py index 1e867f02e5..05be328f6e 100644 --- a/conf.py +++ b/conf.py @@ -18,14 +18,14 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# sys.path.insert(0, os.path.abspath('.')) sys.path.append(os.path.abspath('tools')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. @@ -37,7 +37,7 @@ source_suffix = '.rst' # The encoding of source files. -#source_encoding = 'utf-8-sig' +# source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' @@ -57,37 +57,37 @@ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -#language = None +# language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -#today = '' +# today = '' # Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' +# today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build', 'venv*', 'env*', 'README.rst'] # The reST default role (used for this markup: `text`) to use for all documents. -#default_role = None +# default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True +# add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -#add_module_names = True +# add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -#show_authors = False +# show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] +# modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- @@ -95,8 +95,8 @@ # Use the upstream python-docs-theme html_theme = 'python_docs_theme' html_theme_options = { - 'collapsiblesidebar': True, - 'issues_url': 'https://github.com/python/devguide/issues/new', + 'collapsiblesidebar': True, + 'issues_url': 'https://github.com/python/devguide/issues/new', } @@ -111,23 +111,23 @@ html_sidebars = { # Defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars # Removes the quick search block - '**': ['localtoc.html', 'globaltoc.html', 'relations.html', 'customsourcelink.html'], + '**': ['localtoc.html', 'globaltoc.html', 'relations.html', 'customsourcelink.html'] } # Additional static files. html_static_path = ['tools/static'] # A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None +# html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -#html_logo = None +# html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -#html_favicon = None +# html_favicon = None # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -135,37 +135,37 @@ # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -#html_use_smartypants = True +# html_use_smartypants = True # Additional templates that should be rendered to pages, maps page names to # template names. -#html_additional_pages = {} +# html_additional_pages = {} # If false, no module index is generated. -#html_domain_indices = True +# html_domain_indices = True # If false, no index is generated. -#html_use_index = True +# html_use_index = True # If true, the index is split into individual pages for each letter. -#html_split_index = False +# html_split_index = False # If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True +# html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True +# html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True +# html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -#html_use_opensearch = '' +# html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None +# html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'PythonDevelopersGuidedoc' @@ -174,40 +174,45 @@ # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). -#latex_paper_size = 'letter' +# latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). -#latex_font_size = '10pt' +# latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ - ('index', 'PythonDevelopersGuide.tex', u'Python Developer\'s Guide Documentation', - u'Brett Cannon', 'manual'), + ( + 'index', + 'PythonDevelopersGuide.tex', + u'Python Developer\'s Guide Documentation', + u'Brett Cannon', + 'manual', + ) ] # The name of an image file (relative to this directory) to place at the top of # the title page. -#latex_logo = None +# latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -#latex_use_parts = False +# latex_use_parts = False # If true, show page references after internal links. -#latex_show_pagerefs = False +# latex_show_pagerefs = False # If true, show URL addresses after external links. -#latex_show_urls = False +# latex_show_urls = False # Additional stuff for the LaTeX preamble. -#latex_preamble = '' +# latex_preamble = '' # Documents to append as an appendix to all manuals. -#latex_appendices = [] +# latex_appendices = [] # If false, no module index is generated. -#latex_domain_indices = True +# latex_domain_indices = True # -- Options for manual page output -------------------------------------------- @@ -215,8 +220,13 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'pythondevelopersguide', u"Python Developer's Guide Documentation", - [u'Brett Cannon'], 1) + ( + 'index', + 'pythondevelopersguide', + u"Python Developer's Guide Documentation", + [u'Brett Cannon'], + 1, + ) ] # ignore linkcheck anchors for /#/$ANCHOR since it is used for @@ -224,7 +234,7 @@ # http://www.sphinx-doc.org/en/stable/config.html?highlight=linkcheck#confval-linkcheck_anchors_ignore linkcheck_anchors_ignore = [ # match any anchor that starts with a '/' since this is an invalid HTML anchor - '\/.*', + '\/.*' ] # Use our custom CSS stylesheet to differentiate us from the official python diff --git a/tools/rstlint.py b/tools/rstlint.py index d6d612dcef..29fe700d22 100755 --- a/tools/rstlint.py +++ b/tools/rstlint.py @@ -20,26 +20,110 @@ directives = [ # standard docutils ones - 'admonition', 'attention', 'caution', 'class', 'compound', 'container', - 'contents', 'csv-table', 'danger', 'date', 'default-role', 'epigraph', - 'error', 'figure', 'footer', 'header', 'highlights', 'hint', 'image', - 'important', 'include', 'line-block', 'list-table', 'meta', 'note', - 'parsed-literal', 'pull-quote', 'raw', 'replace', - 'restructuredtext-test-directive', 'role', 'rubric', 'sectnum', 'sidebar', - 'table', 'target-notes', 'tip', 'title', 'topic', 'unicode', 'warning', + 'admonition', + 'attention', + 'caution', + 'class', + 'compound', + 'container', + 'contents', + 'csv-table', + 'danger', + 'date', + 'default-role', + 'epigraph', + 'error', + 'figure', + 'footer', + 'header', + 'highlights', + 'hint', + 'image', + 'important', + 'include', + 'line-block', + 'list-table', + 'meta', + 'note', + 'parsed-literal', + 'pull-quote', + 'raw', + 'replace', + 'restructuredtext-test-directive', + 'role', + 'rubric', + 'sectnum', + 'sidebar', + 'table', + 'target-notes', + 'tip', + 'title', + 'topic', + 'unicode', + 'warning', # Sphinx and Python docs custom ones - 'acks', 'attribute', 'autoattribute', 'autoclass', 'autodata', - 'autoexception', 'autofunction', 'automethod', 'automodule', 'centered', - 'cfunction', 'class', 'classmethod', 'cmacro', 'cmdoption', 'cmember', - 'code-block', 'confval', 'cssclass', 'ctype', 'currentmodule', 'cvar', - 'data', 'decorator', 'decoratormethod', 'deprecated-removed', - 'deprecated(?!-removed)', 'describe', 'directive', 'doctest', 'envvar', - 'event', 'exception', 'function', 'glossary', 'highlight', 'highlightlang', - 'impl-detail', 'index', 'literalinclude', 'method', 'miscnews', 'module', - 'moduleauthor', 'opcode', 'pdbcommand', 'productionlist', - 'program', 'role', 'sectionauthor', 'seealso', 'sourcecode', 'staticmethod', - 'tabularcolumns', 'testcode', 'testoutput', 'testsetup', 'toctree', 'todo', - 'todolist', 'versionadded', 'versionchanged' + 'acks', + 'attribute', + 'autoattribute', + 'autoclass', + 'autodata', + 'autoexception', + 'autofunction', + 'automethod', + 'automodule', + 'centered', + 'cfunction', + 'class', + 'classmethod', + 'cmacro', + 'cmdoption', + 'cmember', + 'code-block', + 'confval', + 'cssclass', + 'ctype', + 'currentmodule', + 'cvar', + 'data', + 'decorator', + 'decoratormethod', + 'deprecated-removed', + 'deprecated(?!-removed)', + 'describe', + 'directive', + 'doctest', + 'envvar', + 'event', + 'exception', + 'function', + 'glossary', + 'highlight', + 'highlightlang', + 'impl-detail', + 'index', + 'literalinclude', + 'method', + 'miscnews', + 'module', + 'moduleauthor', + 'opcode', + 'pdbcommand', + 'productionlist', + 'program', + 'role', + 'sectionauthor', + 'seealso', + 'sourcecode', + 'staticmethod', + 'tabularcolumns', + 'testcode', + 'testoutput', + 'testsetup', + 'toctree', + 'todo', + 'todolist', + 'versionadded', + 'versionchanged', ] all_directives = '(' + '|'.join(directives) + ')' @@ -55,12 +139,14 @@ def checker(*suffixes, **kwds): """Decorator to register a function as a checker.""" + def deco(func): for suffix in suffixes: checkers.setdefault(suffix, []).append(func) for prop in checker_props: setattr(func, prop, kwds.get(prop, checker_props[prop])) return func + return deco @@ -84,11 +170,11 @@ def check_suspicious_constructs(fn, lines): inprod = False for lno, line in enumerate(lines): if seems_directive_re.search(line): - yield lno+1, 'comment seems to be intended as a directive' + yield lno + 1, 'comment seems to be intended as a directive' if '.. productionlist::' in line: inprod = True elif not inprod and default_role_re.search(line): - yield lno+1, 'default role used' + yield lno + 1, 'default role used' elif inprod and not line.strip(): inprod = False @@ -98,11 +184,11 @@ def check_whitespace(fn, lines): """Check for whitespace and line length issues.""" for lno, line in enumerate(lines): if '\r' in line: - yield lno+1, '\\r in line' + yield lno + 1, '\\r in line' if '\t' in line: - yield lno+1, 'OMG TABS!!!1' + yield lno + 1, 'OMG TABS!!!1' if line[:-1].rstrip(' \t') != line[:-1]: - yield lno+1, 'trailing whitespace' + yield lno + 1, 'trailing whitespace' @checker('.rst', severity=0) @@ -111,12 +197,14 @@ def check_line_length(fn, lines): for lno, line in enumerate(lines): if len(line) > 81: # don't complain about tables, links and function signatures - if line.lstrip()[0] not in '+|' and \ - 'http://' not in line and \ - not line.lstrip().startswith(('.. function', - '.. method', - '.. cfunction')): - yield lno+1, "line too long" + if ( + line.lstrip()[0] not in '+|' + and 'http://' not in line + and not line.lstrip().startswith( + ('.. function', '.. method', '.. cfunction') + ) + ): + yield lno + 1, "line too long" @checker('.html', severity=2, falsepositives=True) @@ -126,18 +214,21 @@ def check_leaked_markup(fn, lines): """ for lno, line in enumerate(lines): if leaked_markup_re.search(line): - yield lno+1, 'possibly leaked markup: %r' % line + yield lno + 1, 'possibly leaked markup: %r' % line def main(argv): - usage = '''\ + usage = ( + '''\ Usage: %s [-v] [-f] [-s sev] [-i path]* [path] Options: -v verbose (print all checked file names) -f enable checkers that yield many false positives -s sev only show problems with severity >= sev -i path ignore subdir or file path -'''% argv[0] +''' + % argv[0] + ) try: gopts, args = getopt.getopt(argv[1:], 'vfs:i:') except getopt.GetoptError: @@ -221,8 +312,10 @@ def main(argv): else: for severity in sorted(count): number = count[severity] - print('%d problem%s with severity %d found.' % - (number, number > 1 and 's' or '', severity)) + print( + '%d problem%s with severity %d found.' + % (number, number > 1 and 's' or '', severity) + ) return int(bool(count)) diff --git a/tools/serve.py b/tools/serve.py index c47f889baa..98b1e5d46c 100755 --- a/tools/serve.py +++ b/tools/serve.py @@ -35,4 +35,3 @@ def app(environ, respond): httpd.serve_forever() except KeyboardInterrupt: print("\b\bShutting down.") - From b1f807dea50c72038f6d52ab4ca2e62c9fcde6d9 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sun, 10 Jun 2018 19:22:53 -0700 Subject: [PATCH 2/7] add badge for codestyle --- README.rst | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index ae2b0814b6..dc6b167072 100644 --- a/README.rst +++ b/README.rst @@ -1,14 +1,20 @@ The CPython Developer's Guide ============================= -.. image:: https://readthedocs.org/projects/cpython-devguide/badge/ +|ReadTheDocs| |Zulip| |Codestyle| + +.. |ReadTheDocs| image:: https://readthedocs.org/projects/cpython-devguide/badge/ :target: https://devguide.python.org :alt: Documentation Status -.. image:: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg +.. |Zulip| image:: https://img.shields.io/badge/zulip-join_chat-brightgreen.svg :alt: Python Zulip chat :target: https://python.zulipchat.com - + +.. |Codestyle| image:: https://img.shields.io/badge/code%20style-black-000000.svg + :target: https://github.com/ambv/black + :alt: Code style is black + This guide covers how to contribute to CPython. It is known by the nickname of "the devguide" by the Python core developers. From e3729639144ced3796bd532ff8d0637998b51025 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Mon, 11 Jun 2018 19:01:36 -0700 Subject: [PATCH 3/7] make all dicts and lists consistent with a trailing comma --- conf.py | 84 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/conf.py b/conf.py index 05be328f6e..29fd1fd266 100644 --- a/conf.py +++ b/conf.py @@ -18,26 +18,26 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -# sys.path.insert(0, os.path.abspath('.')) +#sys.path.insert(0, os.path.abspath('.')) sys.path.append(os.path.abspath('tools')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. -# needs_sphinx = '1.0' +#needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo'] -intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} +extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo',] +intersphinx_mapping = {'python': ('https://docs.python.org/3', None),} todo_include_todos = True # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. -# source_encoding = 'utf-8-sig' +#source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' @@ -57,37 +57,37 @@ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. -# language = None +#language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: -# today = '' +#today = '' # Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' +#today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build', 'venv*', 'env*', 'README.rst'] +exclude_patterns = ['_build', 'venv*', 'env*', 'README.rst',] # The reST default role (used for this markup: `text`) to use for all documents. -# default_role = None +#default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True +#add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). -# add_module_names = True +#add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. -# show_authors = False +#show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] +#modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- @@ -105,29 +105,29 @@ html_title = "%s %s" % (project, release) # Path to find HTML templates. -templates_path = ['tools/templates'] +templates_path = ['tools/templates',] # Custom sidebar templates, filenames relative to this file. html_sidebars = { # Defaults taken from http://www.sphinx-doc.org/en/stable/config.html#confval-html_sidebars # Removes the quick search block - '**': ['localtoc.html', 'globaltoc.html', 'relations.html', 'customsourcelink.html'] + '**': ['localtoc.html', 'globaltoc.html', 'relations.html', 'customsourcelink.html'], } # Additional static files. -html_static_path = ['tools/static'] +html_static_path = ['tools/static',] # A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None +#html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. -# html_logo = None +#html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. -# html_favicon = None +#html_favicon = None # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. @@ -135,37 +135,37 @@ # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. -# html_use_smartypants = True +#html_use_smartypants = True # Additional templates that should be rendered to pages, maps page names to # template names. -# html_additional_pages = {} +#html_additional_pages = {} # If false, no module index is generated. -# html_domain_indices = True +#html_domain_indices = True # If false, no index is generated. -# html_use_index = True +#html_use_index = True # If true, the index is split into individual pages for each letter. -# html_split_index = False +#html_split_index = False # If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True +#html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True +#html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True +#html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. -# html_use_opensearch = '' +#html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None +#html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'PythonDevelopersGuidedoc' @@ -174,10 +174,10 @@ # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). -# latex_paper_size = 'letter' +#latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). -# latex_font_size = '10pt' +#latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). @@ -188,31 +188,31 @@ u'Python Developer\'s Guide Documentation', u'Brett Cannon', 'manual', - ) + ), ] # The name of an image file (relative to this directory) to place at the top of # the title page. -# latex_logo = None +#latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. -# latex_use_parts = False +#latex_use_parts = False # If true, show page references after internal links. -# latex_show_pagerefs = False +#latex_show_pagerefs = False # If true, show URL addresses after external links. -# latex_show_urls = False +#latex_show_urls = False # Additional stuff for the LaTeX preamble. -# latex_preamble = '' +#latex_preamble = '' # Documents to append as an appendix to all manuals. -# latex_appendices = [] +#latex_appendices = [] # If false, no module index is generated. -# latex_domain_indices = True +#latex_domain_indices = True # -- Options for manual page output -------------------------------------------- @@ -226,7 +226,7 @@ u"Python Developer's Guide Documentation", [u'Brett Cannon'], 1, - ) + ), ] # ignore linkcheck anchors for /#/$ANCHOR since it is used for @@ -234,7 +234,7 @@ # http://www.sphinx-doc.org/en/stable/config.html?highlight=linkcheck#confval-linkcheck_anchors_ignore linkcheck_anchors_ignore = [ # match any anchor that starts with a '/' since this is an invalid HTML anchor - '\/.*' + '\/.*', ] # Use our custom CSS stylesheet to differentiate us from the official python From 6265e0c81032942957a1cfa1d2c46e1024e74a4e Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Mon, 11 Jun 2018 19:16:51 -0700 Subject: [PATCH 4/7] edits per @serhiy-storchaka and @terryjreedy review --- tools/rstlint.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/tools/rstlint.py b/tools/rstlint.py index 29fe700d22..9b52ce44a4 100755 --- a/tools/rstlint.py +++ b/tools/rstlint.py @@ -218,17 +218,15 @@ def check_leaked_markup(fn, lines): def main(argv): - usage = ( - '''\ + usage = '''\ Usage: %s [-v] [-f] [-s sev] [-i path]* [path] Options: -v verbose (print all checked file names) -f enable checkers that yield many false positives -s sev only show problems with severity >= sev -i path ignore subdir or file path -''' - % argv[0] - ) +'''% argv[0] + try: gopts, args = getopt.getopt(argv[1:], 'vfs:i:') except getopt.GetoptError: @@ -312,10 +310,8 @@ def main(argv): else: for severity in sorted(count): number = count[severity] - print( - '%d problem%s with severity %d found.' - % (number, number > 1 and 's' or '', severity) - ) + print('%d problem%s with severity %d found.' % + (number, 's' if number > 1 else '', severity)) return int(bool(count)) From f021ebbf8ec35c475408542bad1ff2c88e93d981 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 16 Jun 2018 11:25:26 -0700 Subject: [PATCH 5/7] Edit per @serhiy-storchaka review --- conf.py | 2 +- tools/rstlint.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf.py b/conf.py index 29fd1fd266..7cad6633c6 100644 --- a/conf.py +++ b/conf.py @@ -29,7 +29,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo',] +extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo'] intersphinx_mapping = {'python': ('https://docs.python.org/3', None),} todo_include_todos = True diff --git a/tools/rstlint.py b/tools/rstlint.py index 9b52ce44a4..ed236fd33c 100755 --- a/tools/rstlint.py +++ b/tools/rstlint.py @@ -225,7 +225,7 @@ def main(argv): -f enable checkers that yield many false positives -s sev only show problems with severity >= sev -i path ignore subdir or file path -'''% argv[0] +''' % argv[0] try: gopts, args = getopt.getopt(argv[1:], 'vfs:i:') From 347da02c9e76abec184da906b139050c0e05357f Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Sat, 16 Jun 2018 11:40:02 -0700 Subject: [PATCH 6/7] Edit per @serihy-storchaka clarification --- conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf.py b/conf.py index 7cad6633c6..6f01e5b594 100644 --- a/conf.py +++ b/conf.py @@ -30,7 +30,7 @@ # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.intersphinx', 'sphinx.ext.todo'] -intersphinx_mapping = {'python': ('https://docs.python.org/3', None),} +intersphinx_mapping = {'python': ('https://docs.python.org/3', None)} todo_include_todos = True # The suffix of source filenames. @@ -67,7 +67,7 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. -exclude_patterns = ['_build', 'venv*', 'env*', 'README.rst',] +exclude_patterns = ['_build', 'venv*', 'env*', 'README.rst'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None @@ -105,7 +105,7 @@ html_title = "%s %s" % (project, release) # Path to find HTML templates. -templates_path = ['tools/templates',] +templates_path = ['tools/templates'] # Custom sidebar templates, filenames relative to this file. html_sidebars = { @@ -115,7 +115,7 @@ } # Additional static files. -html_static_path = ['tools/static',] +html_static_path = ['tools/static'] # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None From 681eb8eebf44e0176b5175413afcf09e37aeb1c5 Mon Sep 17 00:00:00 2001 From: Carol Willing Date: Fri, 14 Sep 2018 08:11:27 -0700 Subject: [PATCH 7/7] Remove unneeded unicode u --- conf.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conf.py b/conf.py index 6f01e5b594..6c0cff11d1 100644 --- a/conf.py +++ b/conf.py @@ -43,8 +43,8 @@ master_doc = 'index' # General information about the project. -project = u'Python Developer\'s Guide' -copyright = u'2011-%s, Python Software Foundation' % time.strftime('%Y') +project = 'Python Developer\'s Guide' +copyright = '2011-%s, Python Software Foundation' % time.strftime('%Y') # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -185,8 +185,8 @@ ( 'index', 'PythonDevelopersGuide.tex', - u'Python Developer\'s Guide Documentation', - u'Brett Cannon', + 'Python Developer\'s Guide Documentation', + 'Brett Cannon', 'manual', ), ] @@ -223,8 +223,8 @@ ( 'index', 'pythondevelopersguide', - u"Python Developer's Guide Documentation", - [u'Brett Cannon'], + "Python Developer's Guide Documentation", + ['Brett Cannon'], 1, ), ]