Page MenuHomePhabricator

Install setuptools >= 49.4.0 on Toolforge
Closed, DeclinedPublic

Description

Background

  • Pywikibot actively supports Python 3.5 - 3.10
  • distutils package is deprecated with Python 3.10 and will be removed with Python 3.12
  • For comparing version strings Pywikibot uses the version vendor package of pgk_resources 20.4 which is shipped with setuptools 49.4.0; older vendor package release does not support the required release property for comparing release tuples.

Current behaviour

If the Vendor package is older than 20.4 (setuptools older then 49.4.0) calling a script trough the pwb.py wrapper may fail like this:

C:\pwb\GIT\core>py -3.5 pwb.py touch
(setuptools 28.8.0 (c:\python35\lib\site-packages), Requirement.parse('setuptools!=50.0.0,<50.2.0,>=49.4.0; python_version < "3.6"'))

A package necessary for pywikibot is outdated.
Please update required module with:


    pip install "setuptools!=50.0.0,<50.2.0,>=49.4.0"


You may continue on your own risk; type CTRL-C to stop.
Traceback (most recent call last):
  File "pwb.py", line 399, in <module>
    if not main():
  File "pwb.py", line 394, in main
    module)
  File "pwb.py", line 93, in run_python_file
    check_pwb_versions(package)
  File "pwb.py", line 51, in check_pwb_versions
    if scripts_version.release > wikibot_version.release:
AttributeError: 'Version' object has no attribute 'release'
CRITICAL: Exiting due to uncaught exception <class 'AttributeError'>

Expected behavior

Run the script sucessfully after setuptools >= 49.4.0 is installed like:

C:\pwb\GIT\core>py -3.5 pwb.py touch
ERROR: Unable to execute script because no generator was defined.
Use -help for further information.

setuptools requirements

setuptools>=49.4.0, !=50.0.0, <50.2.0 ; python_version < '3.6'
setuptools>=49.4.0 ; python_version >= '3.6'

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript
Xqt renamed this task from Install setuptools >= 49.4.0 ol tools to Install setuptools >= 49.4.0 to tools.Jun 4 2021, 1:17 PM
Xqt renamed this task from Install setuptools >= 49.4.0 to tools to Install setuptools >= 49.4.0 on tools.Jun 4 2021, 2:03 PM

Toolforge Grid is currently being moved (T277653) from Debian 9/Stretch (ships with python3-setuptools 33.1.1) to 10/Buster (40.8.0). The next Debian version, 11/Bullseye, will ship with 52.0.0. I was hoping this would have been easily solved with the Buster upgrade as we're hoping to entirely decomission the grid engine before it needs to be upgraded to Bullseye.

JJMC89 renamed this task from Install setuptools >= 49.4.0 on tools to Install setuptools >= 49.4.0 on Toolforge.Jun 8 2021, 3:44 PM
JJMC89 moved this task from Backlog to Wikimedia prod/Cloud Services issues on the Pywikibot board.
This comment was removed by Dvorapa.

As a workaround we could temporarily install newer setuptools into /shared/pywikibot/setuptools, like we do with mwparserfromhell. Not sure if it will work this way though.

I'm closing all grid engine install/update tasks as the [[ grid engine is being removed | https://wikitech.wikimedia.org/wiki/News/Toolforge_Grid_Engine_deprecation ]]. Please see the instructions page on how to migrate your tool to Kubernetes. Thanks.