[Pywikibot-commits] [Gerrit] ...core[master]: [IMPR] use @staticmethod for several methods
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950204 ) Change subject: [IMPR] use @staticmethod for several methods .. [IMPR] use @staticmethod for several methods Change-Id: I3c0cd141d036acba009d74148b694511dfe8c83c --- M tests/oauth_tests.py M tests/replacebot_tests.py M tests/edit_failure_tests.py M tests/paraminfo_tests.py M pywikibot/site/_basesite.py 5 files changed, 22 insertions(+), 8 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/pywikibot/site/_basesite.py b/pywikibot/site/_basesite.py index eec692a..7292efc 100644 --- a/pywikibot/site/_basesite.py +++ b/pywikibot/site/_basesite.py @@ -231,7 +231,8 @@ yield base_path + '?title={}' yield self.articlepath -def _build_namespaces(self): +@staticmethod +def _build_namespaces(): """Create default namespaces.""" return Namespace.builtin_namespaces() diff --git a/tests/edit_failure_tests.py b/tests/edit_failure_tests.py index b09abf6..8b1109c 100755 --- a/tests/edit_failure_tests.py +++ b/tests/edit_failure_tests.py @@ -8,7 +8,7 @@ These tests use special code 'write = -1' for edit failures. """ # -# (C) Pywikibot team, 2014-2022 +# (C) Pywikibot team, 2014-2023 # # Distributed under the terms of the MIT license. # @@ -148,7 +148,8 @@ with self.assertRaises(PageSaveRelatedError): item.save() -def _make_WbMonolingualText_claim(self, repo, text, language): +@staticmethod +def _make_WbMonolingualText_claim(repo, text, language): """Make a WbMonolingualText and set its value.""" claim = pywikibot.page.Claim(repo, 'P271', datatype='monolingualtext') target = pywikibot.WbMonolingualText(text=text, language=language) diff --git a/tests/oauth_tests.py b/tests/oauth_tests.py index 7546995..4364367 100755 --- a/tests/oauth_tests.py +++ b/tests/oauth_tests.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """Test OAuth functionality.""" # -# (C) Pywikibot team, 2015-2022 +# (C) Pywikibot team, 2015-2023 # # Distributed under the terms of the MIT license. # @@ -24,7 +24,8 @@ oauth = True -def _get_oauth_tokens(self): +@staticmethod +def _get_oauth_tokens(): """Get valid OAuth tokens from environment variables.""" tokens = os.environ.get('PYWIKIBOT_TEST_OAUTH') return tuple(tokens.split(':')) if tokens is not None else None diff --git a/tests/paraminfo_tests.py b/tests/paraminfo_tests.py index 13d67afd..f5877f4 100755 --- a/tests/paraminfo_tests.py +++ b/tests/paraminfo_tests.py @@ -22,7 +22,8 @@ """Base class for paraminfo checks.""" -def _get_param_values(self, site, module, parameter): +@staticmethod +def _get_param_values(site, module, parameter): """Perform check that a parameter matches the expected list.""" with skipping( ValueError, diff --git a/tests/replacebot_tests.py b/tests/replacebot_tests.py index 291d9a2..d678c0b 100755 --- a/tests/replacebot_tests.py +++ b/tests/replacebot_tests.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 """Tests for the replace script and ReplaceRobot class.""" # -# (C) Pywikibot team, 2015-2022 +# (C) Pywikibot team, 2015-2023 # # Distributed under the terms of the MIT license. # @@ -86,7 +86,8 @@ self.inputs.append(message) return 'TESTRUN' -def _run(self, *args): +@staticmethod +def _run(*args): """Run the :py:obj:`replace.main` with the given args. It also adds -site and -page parameters: -- To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950204 To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Change-Id: I3c0cd141d036acba009d74148b694511dfe8c83c Gerrit-Change-Number: 950204 Gerrit-PatchSet: 1 Gerrit-Owner: Xqt Gerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot Gerrit-MessageType: merged ___ Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org
[Pywikibot-commits] [Gerrit] ...core[master]: [doc] Use Sphinx 7.2.2 for documentation
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950148 ) Change subject: [doc] Use Sphinx 7.2.2 for documentation .. [doc] Use Sphinx 7.2.2 for documentation Change-Id: I47ddefc05f1fb9d160f12739008cd01068c28329 --- M docs/conf.py M docs/requirements.txt M tox.ini 3 files changed, 16 insertions(+), 7 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/docs/conf.py b/docs/conf.py index f8edf4d..86f64aa 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -43,7 +43,7 @@ # If your documentation needs a minimal Sphinx version, state it here. # -needs_sphinx = '7.1.0' +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 diff --git a/docs/requirements.txt b/docs/requirements.txt index 593130e..d6cd828 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ # This is a PIP requirements file for building Sphinx documentation of pywikibot # requirements.txt is also needed -sphinx >= 7.1.0 +sphinx >= 7.2.2 rstcheck >=6.1.2 -sphinxext-opengraph >= 0.8.1 -furo >= 2023.7.26 +sphinxext-opengraph >= 0.8.2 +furo >= 2023.8.17 diff --git a/tox.ini b/tox.ini index 21cbd8f..9b2d999 100644 --- a/tox.ini +++ b/tox.ini @@ -83,7 +83,7 @@ commands = {posargs} [testenv:doc] -basepython = python3.8 +basepython = python3.9 commands = sphinx-build -M html ./docs ./docs/_build -j auto deps = @@ -91,7 +91,7 @@ -rdocs/requirements.txt [testenv:rstcheck] -basepython = python3.8 +basepython = python3.9 commands = rstcheck --version rstcheck -r --report-level WARNING --ignore-roles api,phab . @@ -100,7 +100,7 @@ -rdocs/requirements.txt [testenv:sphinx] -basepython = python3.8 +basepython = python3.9 commands = sphinx-build -M html ./docs ./docs/_build -j auto -D html_theme=nature deps = -- To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950148 To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Change-Id: I47ddefc05f1fb9d160f12739008cd01068c28329 Gerrit-Change-Number: 950148 Gerrit-PatchSet: 2 Gerrit-Owner: Xqt Gerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot Gerrit-MessageType: merged ___ Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org
[Pywikibot-commits] [Gerrit] ...core[master]: [doc] Update ROADMAP.rst, HISTORY.rst and CHANGELOG.rst
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950147 ) Change subject: [doc] Update ROADMAP.rst, HISTORY.rst and CHANGELOG.rst .. [doc] Update ROADMAP.rst, HISTORY.rst and CHANGELOG.rst Change-Id: I90ee4f27af81f711ff28e8050ec610984b27b85f --- M ROADMAP.rst M scripts/CHANGELOG.rst M pywikibot/__metadata__.py M HISTORY.rst 4 files changed, 26 insertions(+), 3 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/HISTORY.rst b/HISTORY.rst index 0de5bc6..23e7c7f 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,15 @@ Release history === +8.3.1 +- +*17. August 2023* + +* Add support for suwikisource and blkwiktionary (:phab:`T343544`, :phab:`T343550`) +* :mod:`families.wikifunctions_family` was added (:phab:`T343573`) +* i18n updates + + 8.3.0 - *27 July 2023* @@ -10,7 +19,7 @@ * All wbtypes are placed in ``pywkibot._wbtypes`` module * Use ``site.lang`` instead of ``site.code`` in :func:`comms.http.user_agent` (:phab:`T228322`) * Make header extraction in :func:`textlib.extract_sections` more robust (:phab:`T341787`) -* + 8.2.0 - diff --git a/ROADMAP.rst b/ROADMAP.rst index 877442c..fa0e205 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -1,7 +1,7 @@ Current release --- -* :mod:`families.wikifunctions_family` was added (:phab:`T343573`) +* Add https scheme if missing in url asked by :mod:`pywikibot.scripts.generate_family_file` * i18n updates * use inline re.IGNORECASE flag in :func:`textlib.case_escape` function (:phab:`T308265`) * Convert URL-encoded characters also for links outside main namespace with diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py index 31fb93a..b2cecd6 100644 --- a/pywikibot/__metadata__.py +++ b/pywikibot/__metadata__.py @@ -11,7 +11,7 @@ __name__ = 'pywikibot' -__version__ = '8.4.0.dev0' +__version__ = '8.4.0.dev1' __description__ = 'Python MediaWiki Bot Framework' __maintainer__ = 'The Pywikibot team' __maintainer_email__ = 'pywiki...@lists.wikimedia.org' diff --git a/scripts/CHANGELOG.rst b/scripts/CHANGELOG.rst index 15eedb7..8f7b62d 100644 --- a/scripts/CHANGELOG.rst +++ b/scripts/CHANGELOG.rst @@ -10,6 +10,11 @@ * Use welcome messages from :class:`scripts.welcome.WelcomeBot` * add more messages to :mod:`i18n` system +newitem +~~~ + +* Enable ``-touch`` in newitem script for confirmed user (:phab:`T343877`) + 8.3.0 - -- To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950147 To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Change-Id: I90ee4f27af81f711ff28e8050ec610984b27b85f Gerrit-Change-Number: 950147 Gerrit-PatchSet: 2 Gerrit-Owner: Xqt Gerrit-Reviewer: D3r1ck01 Gerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot Gerrit-MessageType: merged ___ Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org
[Pywikibot-commits] [Gerrit] ...core[master]: Revert "[tests] Ignore failing archivebot_tests on zh-yue site"
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950070 ) Change subject: Revert "[tests] Ignore failing archivebot_tests on zh-yue site" .. Revert "[tests] Ignore failing archivebot_tests on zh-yue site" This reverts commit 1354db9cffa8b94776b461f5aa47905fbbb39582. Reason for revert: Seems this issue is solved upstream Bug: T343626 Change-Id: I7551d944f64a36a830b17bbeda02540bae9a81ee --- M tests/archivebot_tests.py 1 file changed, 15 insertions(+), 2 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/archivebot_tests.py b/tests/archivebot_tests.py index 98595b4..73283e6 100755 --- a/tests/archivebot_tests.py +++ b/tests/archivebot_tests.py @@ -112,7 +112,7 @@ sites = {code: {'family': 'wikipedia', 'code': code} for code in THREADS} cached = True -expected_failures = ['ar', 'scn', 'th', 'zh-yue'] +expected_failures = ['ar', 'scn', 'th'] def test_archivebot(self, code=None): """Test archivebot for one site.""" @@ -155,7 +155,6 @@ # Han.. # for new entries it should work # 'th': year is 2552 while regex assumes 19..|20.., might be fixed -# 'yue': T343626 class TestArchiveBotAfterDateUpdate(TestCase): -- To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950070 To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Change-Id: I7551d944f64a36a830b17bbeda02540bae9a81ee Gerrit-Change-Number: 950070 Gerrit-PatchSet: 2 Gerrit-Owner: Xqt Gerrit-Reviewer: Xqt Gerrit-Reviewer: jenkins-bot Gerrit-MessageType: merged ___ Pywikibot-commits mailing list -- pywikibot-commits@lists.wikimedia.org To unsubscribe send an email to pywikibot-commits-le...@lists.wikimedia.org
[Pywikibot-commits] [Gerrit] ...core[stable]: [8.3.1] Update family files
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/950137 ) Change subject: [8.3.1] Update family files .. [8.3.1] Update family files - add wikifunctions_family file - add support for suwikisource and blkwiktionary - update sphinx/furo Change-Id: I9b6c9e5326431d85ca8e0de2a6d2a210353213ca --- M pywikibot/families/wikisource_family.py M ROADMAP.rst M docs/conf.py M pywikibot/family.py M docs/api_ref/pywikibot.families.rst M pywikibot/__metadata__.py A pywikibot/families/wikifunctions_family.py M docs/requirements.txt M HISTORY.rst M pywikibot/families/wikiversity_family.py M pywikibot/families/wikiquote_family.py M pywikibot/families/wiktionary_family.py M pywikibot/families/wikipedia_family.py 13 files changed, 95 insertions(+), 50 deletions(-) Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified diff --git a/HISTORY.rst b/HISTORY.rst index 6dd9ca5..831d538 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,17 @@ Release history === +8.3.0 +- +*27 July 2023* + +* Add support for btmwiktionary (:phab:`T336117`) +* Add 'yue'/'zh-yue' code_aliases to family files (:phab:`T341960`) +* All wbtypes are placed in ``pywkibot._wbtypes`` module +* Use ``site.lang`` instead of ``site.code`` in :func:`comms.http.user_agent` (:phab:`T228322`) +* Make header extraction in :func:`textlib.extract_sections` more robust (:phab:`T341787`) +* + 8.2.0 - *05 July 2023* diff --git a/ROADMAP.rst b/ROADMAP.rst index a1acaa7..12fb9ad 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -1,11 +1,9 @@ Current release --- -* Add support for btmwiktionary (:phab:`T336117`) -* Add 'yue'/'zh-yue' code_aliases to family files (:phab:`T341960`) -* All wbtypes are placed in ``pywkibot._wbtypes`` module -* Use ``site.lang`` instead of ``site.code`` in :func:`comms.http.user_agent` (:phab:`T228322`) -* Make header extraction in :func:`textlib.extract_sections` more robust (:phab:`T341787`) +* Add support for suwikisource and blkwiktionary (:phab:`T343544`, :phab:`T343550`) +* :mod:`families.wikifunctions_family` was added (:phab:`T343573`) +* i18n updates Deprecations diff --git a/docs/api_ref/pywikibot.families.rst b/docs/api_ref/pywikibot.families.rst index 183ea6d..5dcafe4 100644 --- a/docs/api_ref/pywikibot.families.rst +++ b/docs/api_ref/pywikibot.families.rst @@ -83,6 +83,12 @@ .. automodule:: families.wikidata_family :synopsis: Family module for Wikidata +:mod:`families.wikifunctions\_family` --- Wikifunctions +=== + +.. automodule:: families.wikifunctions_family + :synopsis: Family module for Wikifunctions + :mod:`families.wikihow\_family` --- Wikihow === diff --git a/docs/conf.py b/docs/conf.py index e29746b..f8edf4d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -43,7 +43,7 @@ # If your documentation needs a minimal Sphinx version, state it here. # -needs_sphinx = '6.2.1' +needs_sphinx = '7.1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom @@ -53,9 +53,7 @@ 'sphinx.ext.autosectionlabel', 'sphinx.ext.autosummary', 'sphinx.ext.extlinks', -# 'sphinx.ext.intersphinx', 'sphinx.ext.napoleon', -'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinxext.opengraph', ] @@ -142,7 +140,7 @@ # keep_warnings = False # If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True +# todo_include_todos = False # -- Options for HTML output -- diff --git a/docs/requirements.txt b/docs/requirements.txt index c16dfa7..593130e 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,6 +1,6 @@ # This is a PIP requirements file for building Sphinx documentation of pywikibot # requirements.txt is also needed -sphinx >= 6.2.1, < 7.0 +sphinx >= 7.1.0 rstcheck >=6.1.2 sphinxext-opengraph >= 0.8.1 -furo >= 2023.3.27 +furo >= 2023.7.26 diff --git a/pywikibot/__metadata__.py b/pywikibot/__metadata__.py index 6d7d27f..3b0d4d8 100644 --- a/pywikibot/__metadata__.py +++ b/pywikibot/__metadata__.py @@ -11,7 +11,7 @@ __name__ = 'pywikibot' -__version__ = '8.3.0' +__version__ = '8.3.1' __description__ = 'Python MediaWiki Bot Framework' __maintainer__ = 'The Pywikibot team' __maintainer_email__ = 'pywiki...@lists.wikimedia.org' diff --git a/pywikibot/families/wikifunctions_family.py b/pywikibot/families/wikifunctions_family.py new file mode 100644 index 000..0810392 --- /dev/null +++ b/pywikibot/families/wikifunctions_family.py @@ -0,0 +1,18 @@ +"""Family module for Wikifunction. + +.. versionadded:: 8.4 +""" +# +# (C) Pywikibot team, 2023 +# +# Distributed under the terms of the MIT license. +# +from pywikibot import family + + +class