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'