jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1200414?usp=email )
Change subject: Cleanup: Drop support for Python 3.9 ......................................................................
Cleanup: Drop support for Python 3.9
Python 3.9 support will be dropped.
- remove deprecation message in pwb.py - no longer run tests with Python 3.9 - update github workflows - update dependencies - update utils - update pyproject.toml
Bug: T401802 Change-Id: I656b129db7d86157c7a5288b90a8db5f9f64f29f --- M .github/workflows/doctest.yml M .github/workflows/login_tests-ci.yml M .github/workflows/oauth_tests-ci.yml M .github/workflows/pywikibot-ci.yml M .github/workflows/sysop_write_tests-ci.yml M .github/workflows/windows_tests.yml M dev-requirements.txt M pwb.py M pyproject.toml M requirements.txt M scripts/pyproject.toml M setup.py M tests/utils.py 13 files changed, 68 insertions(+), 111 deletions(-)
Approvals: jenkins-bot: Verified Xqt: Looks good to me, approved
diff --git a/.github/workflows/doctest.yml b/.github/workflows/doctest.yml index 419bb23..bb7e9f4 100644 --- a/.github/workflows/doctest.yml +++ b/.github/workflows/doctest.yml @@ -20,9 +20,8 @@ timeout-minutes: 10 strategy: fail-fast: false - max-parallel: 17 matrix: - python-version: [pypy3.8, pypy3.11, '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: [pypy3.9, pypy3.11, '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] os: ['windows-latest', 'macOS-latest', 'ubuntu-latest'] include: - python-version: 3.15-dev @@ -47,12 +46,11 @@ run: | python -m pip install --upgrade pip pip --version - pip install "coverage == 7.6.1; python_version < '3.9'" - pip install "coverage >= 7.6.10; python_version > '3.8'" + pip install coverage pip install "tomli; python_version < '3.11'" pip install mwparserfromhell pip install packaging - pip install "PyMySQL >= 1.0.0" + pip install PyMySQL pip install pytest pip install requests-sse pip install wikitextparser diff --git a/.github/workflows/login_tests-ci.yml b/.github/workflows/login_tests-ci.yml index ea6d595..702d9bf 100644 --- a/.github/workflows/login_tests-ci.yml +++ b/.github/workflows/login_tests-ci.yml @@ -42,30 +42,30 @@ fail-fast: false max-parallel: 1 matrix: - python-version: [pypy3.8, pypy3.11, '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', 3.15-dev] + python-version: [pypy3.9, pypy3.11, '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', 3.15-dev] site: ['wikipedia:en', 'wikisource:zh', 'wikipedia:test'] include: - - python-version: '3.8' + - python-version: '3.9' site: false family: wpbeta code: en os: ubuntu-22.04 - - python-version: '3.8' + - python-version: '3.9' site: false family: wpbeta code: zh os: ubuntu-22.04 - - python-version: '3.9' + - python-version: '3.10' site: wsbeta:en - - python-version: '3.8' + - python-version: '3.9' site: wikidata:test os: ubuntu-22.04 - - python-version: '3.10' + - python-version: '3.11' site: wiktionary:ar - - python-version: '3.8' + - python-version: '3.9' site: wikidata:wikidata os: ubuntu-22.04 - - python-version: '3.9' + - python-version: '3.10' site: wowwiki:uk - python-version: 3 site: wikipedia:de @@ -91,8 +91,7 @@ run: | python -m pip install --upgrade pip pip --version - pip install "coverage == 7.6.1; python_version < '3.9'" - pip install "coverage >= 7.6.10; python_version > '3.8'" + pip install coverage pip install "tomli; python_version < '3.11'" pip install mwparserfromhell pip install packaging diff --git a/.github/workflows/oauth_tests-ci.yml b/.github/workflows/oauth_tests-ci.yml index 2f880af..6584f05 100644 --- a/.github/workflows/oauth_tests-ci.yml +++ b/.github/workflows/oauth_tests-ci.yml @@ -22,17 +22,17 @@ strategy: fail-fast: false matrix: - python-version: [pypy3.8, pypy3.11, '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', 3.15-dev] + python-version: [pypy3.9, pypy3.11, '3.9', '3.10', '3.11', '3.12', '3.13', '3.14', 3.15-dev] family: [wikipedia] code: [test] domain: [test.wikipedia.org] include: - - python-version: '3.8' + - python-version: '3.9' family: wpbeta code: en domain: en.wikipedia.beta.wmcloud.org experimental: true - - python-version: '3.8' + - python-version: '3.9' family: wpbeta code: zh domain: zh.wikipedia.beta.wmcloud.org @@ -71,13 +71,12 @@ run: | python -m pip install --upgrade pip pip --version - pip install "coverage == 7.6.1; python_version < '3.9'" - pip install "coverage >= 7.6.10; python_version > '3.8'" + pip install coverage # tomli required for coverage due to T380697 pip install "tomli; python_version < '3.11'" pip install mwparserfromhell # PyJWT added due to T380270 - pip install "PyJWT != 2.10.0, != 2.10.1 ; python_version > '3.8'" + pip install "PyJWT != 2.10.0, != 2.10.1" pip install mwoauth pip install packaging pip install requests diff --git a/.github/workflows/pywikibot-ci.yml b/.github/workflows/pywikibot-ci.yml index 9635b67..de0939d 100644 --- a/.github/workflows/pywikibot-ci.yml +++ b/.github/workflows/pywikibot-ci.yml @@ -23,42 +23,35 @@ timeout-minutes: 100 strategy: fail-fast: false - max-parallel: 19 matrix: - python-version: [pypy3.10, pypy3.11, '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: [pypy3.9, pypy3.10, pypy3.11, '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] site: ['wikipedia:en', 'wikisource:zh'] include: - - python-version: '3.8' + - python-version: '3.9' site: wikipedia:test - - python-version: '3.8' + - python-version: '3.9' site: false family: wpbeta code: en - - python-version: '3.8' + - python-version: '3.9' site: false family: wpbeta code: zh - - python-version: '3.9' - site: wsbeta:en - - python-version: '3.8' - site: wikidata:test - python-version: '3.10' + site: wsbeta:en + - python-version: '3.9' + site: wikidata:test + - python-version: '3.11' site: wiktionary:ar test_no_rc: true - - python-version: '3.8' - site: wikidata:wikidata - python-version: '3.9' + site: wikidata:wikidata + - python-version: '3.10' site: wowwiki:uk - python-version: '3' site: wikipedia:de os: macOS-latest - # ubuntu-22.04 required for pypy3.8 and 3.14-dev due to T382214 - - python-version: pypy3.8 - site: wikipedia:en - os: ubuntu-22.04 - - python-version: pypy3.8 - site: wikisource:zh - os: ubuntu-22.04 + # ubuntu-22.04 required 3.15-dev due to T382214 - python-version: 3.15-dev site: wikipedia:en os: ubuntu-22.04 diff --git a/.github/workflows/sysop_write_tests-ci.yml b/.github/workflows/sysop_write_tests-ci.yml index 8993ab6..2645b80 100644 --- a/.github/workflows/sysop_write_tests-ci.yml +++ b/.github/workflows/sysop_write_tests-ci.yml @@ -22,7 +22,7 @@ strategy: fail-fast: false matrix: - python-version: ['3.8'] + python-version: ['3.9'] site: ['wikipedia:test'] attr: [write and not rights, write and rights, rights and not write] steps: diff --git a/.github/workflows/windows_tests.yml b/.github/workflows/windows_tests.yml index 9c54f80..9eac771 100644 --- a/.github/workflows/windows_tests.yml +++ b/.github/workflows/windows_tests.yml @@ -22,7 +22,7 @@ strategy: fail-fast: false matrix: - python-version: [3.8.0, '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: [3.9.0, '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] python-arch: [x64, x86] site: ['wikipedia:en'] steps: diff --git a/dev-requirements.txt b/dev-requirements.txt index 823b1fb..dd0dbbe 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,23 +1,13 @@ -# This is a PIP 6+ requirements file for development dependencies +# This is a requirements file for development dependencies #
-pytest >= 8.4.2; python_version > "3.8" -pytest == 8.3.5; python_version < "3.9" -pytest-subtests >= 0.14.2; python_version > "3.8" -pytest-subtests == 0.13.1; python_version < "3.9" -pytest-attrib>=0.1.3 -pytest-xvfb>=3.1.1; python_version > "3.8" -pytest-xvfb==3.0.0; python_version < "3.9" +pytest >= 8.4.2 +pytest-subtests >= 0.15.0 +pytest-attrib >= 0.1.3 +pytest-xvfb>=3.1.1
-pre-commit >= 4.3.0; python_version > "3.8" -pre-commit == 3.5.0; python_version < "3.9" +pre-commit >= 4.3.0 coverage>=7.11.0; python_version > "3.9" coverage==7.10.7; python_version == "3.9" -coverage==7.6.1; python_version < "3.9" # required for coverage (T380697) tomli>=2.3.0; python_version < "3.11" - - -# optional but needed for tests -fake-useragent >= 2.2.0; python_version > "3.8" -fake-useragent == 1.5.1; python_version < "3.9" diff --git a/pwb.py b/pwb.py index 07debd3..e8c5ed6 100755 --- a/pwb.py +++ b/pwb.py @@ -16,36 +16,18 @@ Pywikibot is not available on: {version}
-This version of Pywikibot only supports Python 3.8+. -""" -DEPRECATED_PYTHON_MESSAGE = """ - -Python {version} will be dropped soon with Pywikibot 11. -It is recommended to use Python 3.9 or above. -See phab: T401802 for further information. +This version of Pywikibot only supports Python 3.9+. """
def python_is_supported(): """Check that Python is supported.""" - return sys.version_info[:3] >= (3, 8) - - -def python_is_deprecated(): - """Check that Python is deprecated.""" - return sys.version_info[:3] < (3, 9) + return sys.version_info[:3] >= (3, 9)
if not python_is_supported(): # pragma: no cover sys.exit(VERSIONS_REQUIRED_MESSAGE.format(version=sys.version))
-if python_is_deprecated(): - import warnings - msg = DEPRECATED_PYTHON_MESSAGE.format( - version=sys.version.split(maxsplit=1)[0]) - warnings.warn(msg, FutureWarning) # adjust this line no in utils.execute() - del warnings -
def main() -> None: """Entry point for :func:`tests.utils.execute_pwb`.""" diff --git a/pyproject.toml b/pyproject.toml index 9c305cd..f5a48d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ {name = "The Pywikibot team", email = "pywikibot@lists.wikimedia.org"}, ] description = "Python MediaWiki Bot Framework" -requires-python = ">=3.8.0" +requires-python = ">=3.9.0" keywords = [ "API", "bot", "client", "framework", "mediawiki", "pwb", "pybot", "python", "pywiki", "pywikibase", "pywikibot", "pywikipedia", "pywikipediabot", @@ -92,7 +92,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", diff --git a/requirements.txt b/requirements.txt index 42f78a5..bf1fc49 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,38 +26,39 @@ # mwparserfromhell is mandatory but wikitextparser can be used instead # mwparserfromhell is still required for commons_information.py and patrol.py # wikitextparser is required for Page.authorship() -wikitextparser>=0.56.3 +wikitextparser>=0.56.4
# OAuth support # mwoauth 0.2.4 is needed because it supports getting identity information # about the user # Due to T380270 PyJWT must be set -PyJWT != 2.10.0, != 2.10.1; python_version > '3.8' -mwoauth>=0.2.4,!=0.3.1 +PyJWT != 2.10.0, != 2.10.1 +mwoauth>=0.4.0
# interwiki_graph.py module and category_graph.py script: -pydot >= 3.0.2 +pydot >= 4.0.1
# cosmetic_changes -python-stdnum >= 1.20 +python-stdnum >= 2.1
# GUI -Pillow==10.4.0; platform_python_implementation == "PyPy" and python_version < "3.9" Pillow>=11.1.0,<11.3.0; platform_python_implementation == "PyPy" and python_version >= "3.9" and python_version < "3.11" Pillow>=11.1.0; platform_python_implementation == "PyPy" and python_version >= "3.11" -Pillow==10.4.0; platform_python_implementation != "PyPy" and python_version < "3.9" Pillow>=11.1.0,<11.3.0; platform_python_implementation != "PyPy" and python_version == "3.9" -Pillow>=11.1.0; platform_python_implementation != "PyPy" and python_version >= "3.10" +Pillow>=12.0.0; platform_python_implementation != "PyPy" and python_version >= "3.10"
# core pagegenerators googlesearch-python >= 1.3.0 -requests-sse >= 0.5.0 +requests-sse >= 0.5.2
# The mysql generator in pagegenerators depends on PyMySQL -PyMySQL >= 1.1.1 +PyMySQL >= 1.1.2
# core HTML comparison parser in diff module -beautifulsoup4>=4.7.1 +beautifulsoup4>=4.14.2
# scripts/weblinkchecker.py memento_client==0.6.1 + +# optional but also needed for tests +fake-useragent >= 2.2.0 diff --git a/scripts/pyproject.toml b/scripts/pyproject.toml index 842206b..3f80c35 100644 --- a/scripts/pyproject.toml +++ b/scripts/pyproject.toml @@ -17,7 +17,7 @@ ] description = "Pywikibot Scripts Collection" readme = "scripts/README.rst" -requires-python = ">=3.8.0" +requires-python = ">=3.9.0" dependencies = [ "pywikibot >= 11.0.0", "isbnlib", @@ -103,6 +103,13 @@ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Internet :: WWW/HTTP :: Dynamic Content :: Wiki", diff --git a/setup.py b/setup.py index 806f3ec..13b4766 100755 --- a/setup.py +++ b/setup.py @@ -37,36 +37,30 @@ # ------- setup extra_requires ------- # extra_deps = { # Core library dependencies - 'eventstreams': ['requests-sse>=0.5.0'], - 'isbn': ['python-stdnum>=1.20'], - 'Graphviz': ['pydot>=3.0.2'], + 'eventstreams': ['requests-sse>=0.5.2'], + 'isbn': ['python-stdnum>=2.1'], + 'Graphviz': ['pydot>=4.0.1'], 'Google': ['googlesearch-python >= 1.3.0'], 'memento': ['memento_client==0.6.1'], - 'wikitextparser': ['wikitextparser>=0.56.3'], - 'mysql': ['PyMySQL >= 1.1.1'], - # vulnerability found in Pillow<8.1.2 but toolforge uses 5.4.1 + 'wikitextparser': ['wikitextparser>=0.56.4'], + 'mysql': ['PyMySQL >= 1.1.2'], 'Tkinter': [ - 'Pillow==10.4.0; platform_python_implementation == "PyPy" ' - 'and python_version < "3.9"', 'Pillow>=11.1.0,<11.3.0; platform_python_implementation == "PyPy" ' 'and python_version >= "3.9" and python_version < "3.11"', 'Pillow>=11.1.0; platform_python_implementation == "PyPy" ' 'and python_version >= "3.11"', - 'Pillow==10.4.0; platform_python_implementation != "PyPy" ' - 'and python_version < "3.9"', 'Pillow>=11.1.0,<11.3.0; platform_python_implementation != "PyPy" ' 'and python_version == "3.9"', - 'Pillow>=11.1.0; platform_python_implementation != "PyPy" ' + 'Pillow>=12.0.0; platform_python_implementation != "PyPy" ' 'and python_version >= "3.10"', ], 'mwoauth': [ - 'PyJWT != 2.10.0, != 2.10.1; python_version > "3.8"', # T380270 - 'mwoauth!=0.3.1,>=0.2.4', + 'PyJWT != 2.10.0, != 2.10.1', # T380270 + 'mwoauth>=0.4.0', ], 'html': ['beautifulsoup4>=4.7.1'], 'http': [ - 'fake-useragent >= 2.0.3; python_version > "3.8"', - 'fake-useragent == 1.5.1; python_version < "3.9"', + 'fake-useragent >= 2.2.0', ], }
diff --git a/tests/utils.py b/tests/utils.py index bba040a..cf5860f 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -25,7 +25,6 @@ from pywikibot.exceptions import APIError from pywikibot.login import LoginStatus from pywikibot.site import Namespace -from pywikibot.tools import PYTHON_VERSION from pywikibot.tools.collections import EMPTY_DEFAULT from tests import _pwb_py
@@ -475,10 +474,6 @@
:param command: executable to run and arguments to use """ - if PYTHON_VERSION < (3, 9): - command.insert(1, '-W ignore::FutureWarning:pwb:46') - command.insert(1, '-W ignore::FutureWarning:__main__:46') - env = os.environ.copy()
# Prevent output by test package; e.g. 'max_retries reduced from x to y'
pywikibot-commits@lists.wikimedia.org