Page MenuHomePhabricator

Fix bugs in Pywikibot doc generation
Closed, ResolvedPublic

Description

There are many errors during the sphinx documentation generation.

Currently the errors are:

  • pywikibot.FilePage.getFileVersionHistory:6: ERROR: Unexpected indentation.
  • pywikibot.ItemPage.set_redirect_target:7-8: ERROR: Unexpected indentation.
  • pywikibot.WikidataBot.user_edit_entity:8-14: WARNING: Field list ends without a blank line; unexpected unindent.
  • pywikibot.exceptions:32: ERROR: Unexpected indentation.
  • pywikibot.pagegenerators:52: ERROR: Unexpected indentation.
  • pywikibot.pagegenerators:56: ERROR: Unexpected indentation.
  • pywikibot.pagegenerators.GoogleSearchPageGenerator.queryGoogle:5: ERROR: Unexpected indentation.
  • pywikibot.site.APISite.blockuser:8-11: ERROR: Unexpected indentation.
  • pywikibot.site.APISite.blocks:3: ERROR: Unknown target name: "api:query".
  • pywikibot.comms.rcstream.RcListenerThread:24: ERROR: Unexpected indentation.
  • pywikibot.tools.ContextManagerWrapper:9: ERROR: Unexpected indentation.
  • pywikibot.tools.MediaWikiVersion:13: ERROR: Unexpected indentation.

There are a bunch of test classes that have changed name, causing errors.

Almost errors:

  • WARNING: autodoc: failed to import module 'pywikibot.families.wikimedia_family'
  • WARNING: error while formatting arguments for pywikibot.UserActionRefuse: 'function' object has no attribute 'mro'
  • WARNING: error while formatting arguments for pywikibot.data.api.CategoryPageGenerator: 'function' object has no attribute 'mro'
  • WARNING: error while formatting arguments for pywikibot.data.api.ImagePageGenerator: 'function' object has no attribute 'mro'
  • tests/archivebot_tests.rst:9: WARNING: invalid signature for automethod ('tests.archivebot_tests::TestArchiveBot.test_archivebot_zh-yue')

Event Timeline

jayvdb raised the priority of this task from to Needs Triage.
jayvdb updated the task description. (Show Details)

Change 238039 had a related patch set uploaded (by John Vandenberg):
[wip] docs: fixing sphinx errors

https://gerrit.wikimedia.org/r/238039

Change 238084 had a related patch set uploaded (by John Vandenberg):
[WIP] URLs in docstrings

https://gerrit.wikimedia.org/r/238084

Change 238086 had a related patch set uploaded (by John Vandenberg):
Add whitespace in docstrings

https://gerrit.wikimedia.org/r/238086

Change 238087 had a related patch set uploaded (by John Vandenberg):
Fix Sphinx errors in tests

https://gerrit.wikimedia.org/r/238087

Change 238088 had a related patch set uploaded (by John Vandenberg):
Fix meta test name generator

https://gerrit.wikimedia.org/r/238088

jayvdb set Security to None.

Change 238088 merged by jenkins-bot:
Fix meta test name generator

https://gerrit.wikimedia.org/r/238088

Change 238087 merged by jenkins-bot:
Fix Sphinx errors in tests

https://gerrit.wikimedia.org/r/238087

Change 238084 merged by jenkins-bot:
Fix whitespace around URLs in docstrings

https://gerrit.wikimedia.org/r/238084

Maybe that is also mentioned in the opening post but the list of page generator arguments is broken since c2d973ac. Now we could revert that patch but I personally prefer the look of the list instead of a block of code.

Maybe this isn't intended to be a tracking bug, but there are also two other problems with the documentation:

Change 238086 merged by jenkins-bot:
Add whitespace in docstrings

https://gerrit.wikimedia.org/r/238086

Maybe this isn't intended to be a tracking bug, but there are also two other problems with the documentation:

That is T74424.

Maybe that is also mentioned in the opening post but the list of page generator arguments is broken since c2d973ac. Now we could revert that patch but I personally prefer the look of the list instead of a block of code.

Yea, I noticed that 'regression', but agree that it isnt that bad, and can be improved with a few tweaks. But argparse will also completely fix it.

Change 238039 merged by jenkins-bot:
docs: clean up a set of errors

https://gerrit.wikimedia.org/r/238039

jayvdb claimed this task.

All bugs were fixed, and the documentation Jenkins job now fails if there is invalid RST in the docstrings (T112488 , still open as it is not yet a good solution).

Note some warnings still exist, but that is due to T112830 , and other specific tasks should be created for any other issues.