You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Traceback:
Traceback (most recent call last):
File "C:\Python311\Lib\site-packages\sphinx\cmd\build.py", line 298, in build_main
app.build(args.force_all, args.filenames)
File "C:\Python311\Lib\site-packages\sphinx\application.py", line 355, in buildself.builder.build_update()
File "C:\Python311\Lib\site-packages\sphinx\builders\__init__.py", line 293, in build_updateself.build(to_build,
File "C:\Python311\Lib\site-packages\sphinx\builders\__init__.py", line 313, in build
updated_docnames =set(self.read())
^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\sphinx\builders\__init__.py", line 420, in readself._read_serial(docnames)
File "C:\Python311\Lib\site-packages\sphinx\builders\__init__.py", line 441, in _read_serialself.read_doc(docname)
File "C:\Python311\Lib\site-packages\sphinx\builders\__init__.py", line 498, in read_doc
publisher.publish()
File "C:\Python311\Lib\site-packages\docutils\core.py", line 224, in publishself.document =self.reader.read(self.source, self.parser,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\sphinx\io.py", line 105, in readself.parse()
File "C:\Python311\Lib\site-packages\docutils\readers\__init__.py", line 76, in parseself.parser.parse(self.input, document)
File "C:\Python311\Lib\site-packages\sphinx\parsers.py", line 81, in parseself.statemachine.run(inputlines, document, inliner=self.inliner)
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 169, in run
results = StateMachineWS.run(self, input_lines, input_offset,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\statemachine.py", line 233, in run
context, next_state, result =self.check_line(
^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\statemachine.py", line 445, in check_linereturn method(match, context, next_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 3024, in textself.section(title.lstrip(), source, style, lineno +1, messages)
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 325, in sectionself.new_subsection(title, lineno, messages)
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 391, in new_subsection
newabsoffset =self.nested_parse(
^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 279, in nested_parse
state_machine.run(block, input_offset, memo=self.memo,
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\statemachine.py", line 233, in run
context, next_state, result =self.check_line(
^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\statemachine.py", line 445, in check_linereturn method(match, context, next_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 2355, in explicit_markup
nodelist, blank_finish =self.explicit_construct(match)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 2367, in explicit_constructreturn method(self, expmatch)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 2104, in directivereturnself.run_directive(
^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\docutils\parsers\rst\states.py", line 2154, in run_directive
result = directive_instance.run()
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\directive.py", line 139, in run
documenter.generate(more_content=self.content)
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\__init__.py", line 950, in generateself.document_members(all_members)
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\__init__.py", line 824, in document_members
documenter.generate(
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\__init__.py", line 1886, in generatereturnsuper().generate(more_content=more_content,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\__init__.py", line 950, in generateself.document_members(all_members)
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\__init__.py", line 1872, in document_memberssuper().document_members(all_members)
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\__init__.py", line 824, in document_members
documenter.generate(
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\__init__.py", line 869, in generateifnotself.parse_name():
^^^^^^^^^^^^^^^^^
File "C:\Python311\Lib\site-packages\sphinx\ext\autodoc\__init__.py", line 388, in parse_nameassert matched isnotNone
AssertionError
How to Reproduce
"""Configuration file for Sphinx."""## (C) Pywikibot team, 2014-2023## Distributed under the terms of the MIT license.## Pywikibot documentation build configuration file, created by# sphinx-quickstart on Sun Jun 26 00:00:43 2016.## This file is execfile()d with the current directory set to its# containing dir.## Note that not all possible configuration values are present in this# autogenerated file.## All configuration values have a default; values that are commented out# serve to show the default.# 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 Path.resolve() to make it absolute, like shown here.#importosimportreimportsysimportwarningsfrompathlibimportPath# Deprecated classes will generate warnings as Sphinx processes them.# Ignoring them.warnings.simplefilter(action='ignore', category=FutureWarning)
repo_dir=Path(__file__).resolve().parents[1]
sys.path= [str(repo_dir), str(repo_dir/'pywikibot')] +sys.pathos.environ['PYWIKIBOT_NO_USER_CONFIG'] ='1'importpywikibot# noqa: E402# -- General configuration ------------------------------------------------# If your documentation needs a minimal Sphinx version, state it here.#needs_sphinx='7.2.2'# 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.autodoc',
'sphinx.ext.autosectionlabel',
'sphinx.ext.autosummary',
'sphinx.ext.extlinks',
'sphinx.ext.napoleon',
'sphinx.ext.viewcode',
'sphinxext.opengraph',
]
# Add any paths that contain templates here, relative to this directory.templates_path= ['_templates']
# The suffix(es) of source filenames.# You can specify multiple suffix as a list of string:## source_suffix = ['.rst', '.md']source_suffix='.rst'# The encoding of source files.## source_encoding = 'utf-8-sig'# The master toctree document.root_doc='index'# General information about the project.project=pywikibot.__name__.title()
project_copyright=pywikibot.__copyright__# alias since Python 3.5author='Pywikibot Team'# The version info for the project you're documenting, acts as replacement for# |version| and |release|, also used in various other places throughout the# built documents.## The short X.Y version.version=pywikibot.__version__.partition('.dev')[0]
# The full version, including alpha/beta/rc tags.release=pywikibot.__version__# The language for content autogenerated by Sphinx. Refer to documentation# for a list of supported languages.## This is also used if you do content translation via gettext catalogs.# Usually you set "language" from the command line for these cases.language='en'# There are two options for replacing |today|: either, you set today to some# non-false value, then it is used:## today = ''## Else, today_fmt is used as the format for a strftime call.## today_fmt = '%B %d, %Y'# List of patterns, relative to source directory, that match files and# directories to ignore when looking for source files.# These patterns also affect html_static_path and html_extra_pathexclude_patterns= ['_build']
# The reST default role (used for this markup: `text`) to use for all# documents.#default_role='py:obj'# If true, '()' will be appended to :func: etc. cross-reference text.## 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# If true, sectionauthor and moduleauthor directives will be shown in the# output. They are ignored by default.## show_authors = False# The name of the Pygments (syntax highlighting) style to use.pygments_style='default'# A list of ignored prefixes for module index sorting.# modindex_common_prefix = []# If true, keep warnings as "system message" paragraphs in the built documents.# keep_warnings = False# If true, `todo` and `todoList` produce output, else they produce nothing.# todo_include_todos = False# -- Options for HTML output ----------------------------------------------# The theme to use for HTML and HTML Help pages. See the documentation for# a list of builtin themes.#html_theme='furo'# Theme options are theme-specific and customize the look and feel of a theme# further. For a list of options available for each theme, see the# documentation.## Add any paths that contain custom themes here, relative to this directory.# html_theme_path = []# The name for this set of Sphinx documents.# "<project> v<release> documentation" by default.## html_title = 'test vtest'# A shorter title for the navigation bar. Default is the same as html_title.## html_short_title = None# The name of an image file (relative to this directory) to place at the top# of the sidebar.#html_logo='_static/Pywikibot_MW_gear_icon.svg'# Use a PNG version of the logo in OpenGraph social cards# (needed because SVG is not supported)ogp_social_cards= {
'image': '_static/Pywikibot_MW_gear_icon.png',
}
# The name of an image file (relative to this directory) to use as a favicon of# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32# pixels large.#html_favicon='_static/Pywikibot.ico'# Add any paths that contain custom static files (such as style sheets) here,# relative to this directory. They are copied after the builtin static files,# so a file named "default.css" will overwrite the builtin "default.css".html_static_path= ['_static']
# Add any extra paths that contain custom files (such as robots.txt or# .htaccess) here, relative to this directory. These files are copied# directly to the root of the documentation.## html_extra_path = []# If not None, a 'Last updated on:' timestamp is inserted at every page# bottom, using the given strftime format.# The empty string is equivalent to '%b %d, %Y'.## html_last_updated_fmt = None# Custom sidebar templates, maps document names to template names.## html_sidebars = {}# Additional templates that should be rendered to pages, maps page names to# template names.## html_additional_pages = {}# If false, no module index is generated.## html_domain_indices = True# If false, no index is generated.## html_use_index = True# If true, the index is split into individual pages for each letter.#html_split_index=Truedocs_url='https://gerrit.wikimedia.org/g/pywikibot/core/%2B/HEAD/docs/'# HTML Theme Colors# changed to match the palette as described on# https://meta.wikimedia.org/wiki/Brand/colourscolor_primary_blue='#0C57A8'color_blue_bg_light='#0C57A81B'color_blue_bg_dark='#0C57A822'color_blue_text_dark='#94D5FF'color_primary_red='#990000'color_red_bg_light='#99000011'color_red_bg_dark='#99000014'color_red_text_dark='#FF5151'color_primary_green='#339966'color_green_bg_light='#33996612'color_green_bg_dark='#33996633'color_yellow='#F0BC00'color_yellow_bg='#F0BC0022'color_brightblue='#049DFF'color_brightblue_bg='#049DFF22'color_purple='#5748B5'color_purple_bg='#5748B52A'html_theme_options= {
'source_edit_link': docs_url+'{filename}',
'navigation_with_keys': True,
'light_css_variables': {
'color-brand-primary': color_primary_blue,
'color-link': color_primary_blue,
'color-link--hover': color_primary_blue,
'color-problematic': color_primary_red,
'color-admonition-title--note': color_primary_blue,
'color-admonition-title-background--note': color_blue_bg_light,
'color-admonition-title--seealso': color_primary_blue,
'color-admonition-title-background--seealso': color_blue_bg_light,
'color-admonition-title--caution': color_yellow,
'color-admonition-title-background--caution': color_yellow_bg,
'color-admonition-title--warning': color_yellow,
'color-admonition-title-background--warning': color_yellow_bg,
'color-admonition-title--danger': color_primary_red,
'color-admonition-title-background--danger': color_red_bg_light,
'color-admonition-title--error': color_primary_red,
'color-admonition-title-background--error': color_red_bg_light,
'color-admonition-title--attention': color_primary_red,
'color-admonition-title-background--attention': color_red_bg_light,
'color-admonition-title--hint': color_primary_green,
'color-admonition-title-background--hint': color_green_bg_light,
'color-admonition-title--tip': color_primary_green,
'color-admonition-title-background--tip': color_green_bg_light,
'color-admonition-title--important': color_brightblue,
'color-admonition-title-background--important': color_brightblue_bg,
'color-admonition-title': color_purple,
'color-admonition-title-background': color_purple_bg,
},
'dark_css_variables': {
'color-brand-primary': color_blue_text_dark,
'color-link': color_blue_text_dark,
'color-link--hover': color_blue_text_dark,
'color-problematic': color_red_text_dark,
'color-admonition-title--note': color_primary_blue,
'color-admonition-title-background--note': color_blue_bg_dark,
'color-admonition-title--seealso': color_primary_blue,
'color-admonition-title-background--seealso': color_blue_bg_dark,
'color-admonition-title--caution': color_yellow,
'color-admonition-title-background--caution': color_yellow_bg,
'color-admonition-title--warning': color_yellow,
'color-admonition-title-background--warning': color_yellow_bg,
'color-admonition-title--danger': color_primary_red,
'color-admonition-title-background--danger': color_red_bg_dark,
'color-admonition-title--error': color_primary_red,
'color-admonition-title-background--error': color_red_bg_dark,
'color-admonition-title--attention': color_primary_red,
'color-admonition-title-background--attention': color_red_bg_dark,
'color-admonition-title--hint': color_primary_green,
'color-admonition-title-background--hint': color_green_bg_dark,
'color-admonition-title--tip': color_primary_green,
'color-admonition-title-background--tip': color_green_bg_dark,
'color-admonition-title--important': color_brightblue,
'color-admonition-title-background--important': color_brightblue_bg,
'color-admonition-title': color_purple,
'color-admonition-title-background': color_purple_bg,
}
}
# If true, links to the reST sources are added to the pages.## html_show_sourcelink = True# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.## html_show_sphinx = True# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.## html_show_copyright = True# If true, an OpenSearch description file will be output, and all pages will# contain a <link> tag referring to it. The value of this option must be the# base URL from which the finished HTML is served.## html_use_opensearch = ''# This is the file name suffix for HTML files (e.g. ".xhtml").# html_file_suffix = None# Language to be used for generating the HTML full-text search index.# Sphinx supports the following languages:# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr', 'zh'## html_search_language = 'en'# A dictionary with options for the search language support, empty by default.# 'ja' uses this config value.# 'zh' user can custom change `jieba` dictionary path.## html_search_options = {'type': 'default'}# The name of a javascript file (relative to the configuration directory) that# implements a search results scorer. If empty, the default will be used.## html_search_scorer = 'scorer.js'# Output file base name for HTML help builder.htmlhelp_basename=project+release.replace('.', '')
# -- Options for LaTeX output ---------------------------------------------latex_elements= {
# The paper size ('letterpaper' or 'a4paper').## 'papersize': 'letterpaper',# The font size ('10pt', '11pt' or '12pt').## 'pointsize': '10pt',# Additional stuff for the LaTeX preamble.## 'preamble': '',# Latex figure (float) alignment## 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples# (source start file, target name, title,# author, documentclass [howto, manual, or own class]).latex_documents= [
(root_doc, 'Pywikibot.tex', 'Pywikibot Documentation',
author, 'manual'),
]
# The name of an image file (relative to this directory) to place at the top of# the title page.## latex_logo = None# If true, show page references after internal links.## latex_show_pagerefs = False# If true, show URL addresses after external links.## latex_show_urls = False# Documents to append as an appendix to all manuals.## latex_appendices = []# If false, no module index is generated.## latex_domain_indices = True# -- Options for manual page output ---------------------------------------# One entry per manual page. List of tuples# (source start file, name, description, authors, manual section).man_pages= [
(root_doc, project, 'Pywikibot Documentation',
[author], 1)
]
manpages_url='https://www.mediawiki.org/wiki/Manual:Pywikibot/{path}'# If true, show URL addresses after external links.## man_show_urls = False# -- Options for Texinfo output -------------------------------------------# Grouping the document tree into Texinfo files. List of tuples# (source start file, target name, title, author,# dir menu entry, description, category)texinfo_documents= [
(root_doc, project, 'Pywikibot Documentation',
author, project, 'One line description of project.',
'Miscellaneous'),
]
# Documents to append as an appendix to all manuals.## texinfo_appendices = []# If false, no module index is generated.## texinfo_domain_indices = True# How to display URL addresses: 'footnote', 'no', or 'inline'.## texinfo_show_urls = 'footnote'# If true, do not generate a @detailmenu in the "Top" node's menu.## texinfo_no_detailmenu = False# If false, do not generate in manual @ref nodes.## texinfo_cross_references = Falsenumfig=True# Other settingsshow_authors=Truetodo_include_todos=Trueautodoc_typehints='description'# autosectionlabel_prefix_document = Truesuppress_warnings= ['autosectionlabel.*']
toc_object_entries_show_parents='hide'# Napoleon settingsnapoleon_use_admonition_for_examples=Truenapoleon_use_admonition_for_notes=Truenapoleon_use_admonition_for_references=Truenapoleon_custom_sections= ['Advice', 'Advices', 'Hints', 'Rights', 'Tips']
python_use_unqualified_type_names=Truemodindex_common_prefix= ['pywikibot.scripts.']
# Pywikibot theme stylehtml_permalinks_icon='#'html_css_files= [
'css/pywikibot.css',
]
extlinks= {
# MediaWiki API'api': ('https://www.mediawiki.org/wiki/API:%s', 'API:%s'),
# Python bug tracker'bug': ('https://bugs.python.org/issue%s', 'Python issue %s'),
# Python bug tracker'issue': ('https://github.com/python/cpython/issues/%s',
'Python issue %s'),
# Phabricator tasks'phab': ('https://phabricator.wikimedia.org/%s', '%s'),
# Python howto link'pyhow': ('https://docs.python.org/3/howto/%s.html',
'Python Howto %s'),
# Python library link'pylib': ('https://docs.python.org/3/library/%s.html',
'Python Library %s'),
# Generic Python link; should be used with explicit title'python': ('https://docs.python.org/3/%s', None),
}
defpywikibot_docstring_fixups(app, what, name, obj, options, lines):
"""Remove plain 'Initializer.' or 'Allocator.' docstring. .. versionchanged:: 8.2 remove 'Allocator.' docstring too. """ifwhatnotin ('class', 'exception'):
returniflinesandlines[0] in ('Initializer.', 'Allocator.'):
lines[:] =lines[2:]
defpywikibot_script_docstring_fixups(app, what, name, obj, options, lines):
"""Pywikibot specific conversions."""fromscripts.cosmetic_changesimportwarningifwhat!='module':
returnifnotname.startswith('scripts.'):
returnlength=0forindex, lineinenumerate(lines):
# highlight the first lineifindex==0: # highlight the first linelines[0] =f"**{line.strip('.')}**"# add link for pagegenerators optionselifline=='¶ms;':
lines[index] = ('This script supports use of '':py:mod:`pagegenerators` arguments.')
# add link for fixeselifname=='scripts.replace'andline=='&fixes-help;':
lines[index] = (' The available fixes are listed ''in :py:mod:`pywikibot.fixes`.')
# replace cosmetic changes warningelifname=='scripts.cosmetic_changes'andline=='&warning;':
lines[index] =warning# Initiate code block except pagegenerator arguments followselif (line.endswith(':') andnotline.lstrip().startswith(':')
and'Traceback (most recent call last)'notinline):
forafterlineinlines[index+1:]:
ifnotafterline:
continueifafterline!='¶ms;':
lines[index] =line+':'break# adjust optionsifline.startswith('-'):
# Indent optionsmatch=re.match(r'-[^ ]+? +', line)
ifmatch:
length=len(match[0])
lines[index] =' '+lineeliflengthandline.startswith(' '*length):
# Indent descriptions of options (as options are indented)lines[index] =' '+lineelifline:
# Reset lengthlength=0defpywikibot_family_classproperty_getattr(obj, name, *defargs):
"""Custom getattr() to get classproperty instances."""fromsphinx.util.inspectimportsafe_getattrfrompywikibot.familyimportFamilyfrompywikibot.toolsimportclasspropertyifnotisinstance(obj, type) ornotissubclass(obj, Family):
returnsafe_getattr(obj, name, *defargs)
forbase_classinobj.__mro__:
try:
prop=base_class.__dict__[name]
exceptKeyError:
continueifnotisinstance(prop, classproperty):
returnsafe_getattr(obj, name, *defargs)
returnpropreturnsafe_getattr(obj, name, *defargs)
defsetup(app):
"""Implicit Sphinx extension hook."""app.connect('autodoc-process-docstring', pywikibot_docstring_fixups)
app.connect('autodoc-process-docstring', pywikibot_script_docstring_fixups)
app.add_autodoc_attrgetter(type, pywikibot_family_classproperty_getattr)
autoclass_content='both'autodoc_default_options= {
'members': True,
'undoc-members': True,
'special-members': False,
'show-inheritance': True,
}
Describe the bug
How to Reproduce
Environment Information
Sphinx extensions
Additional context
The text was updated successfully, but these errors were encountered: