jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/987422 )
Change subject: [fix] do not check for installed 'importlib_metadata' and
'packaging'
......................................................................
[fix] do not check for installed 'importlib_metadata' and 'packaging'
Both meodules are imported in backports and needed for the check_modules
funktion. Missing modules are already printed during import of pywikibot.
Change-Id: I0c46b5be772812a169de25d329ffb37ee628bab2
---
M pywikibot/scripts/wrapper.py
1 file changed, 22 insertions(+), 2 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/scripts/wrapper.py b/pywikibot/scripts/wrapper.py
index 3b24e25..730b201 100755
--- a/pywikibot/scripts/wrapper.py
+++ b/pywikibot/scripts/wrapper.py
@@ -38,7 +38,7 @@
renamed to wrapper.py
"""
#
-# (C) Pywikibot team, 2012-2023
+# (C) Pywikibot team, 2012-2024
#
# Distributed under the terms of the MIT license.
#
@@ -241,6 +241,14 @@
from setup import dependencies
for dependency in dependencies:
+ if dependency.startswith(('importlib_metadata', 'packaging')):
+ # Ignore these dependencies because ImportError is raised in an
+ # early state when they are imported in backports. They are already
+ # used at this point. This is a workaound for toolforge where some
+ # modules are not installed as a site-package.
+ # TODO: Check imports from external source
+ continue
+
requirement = Requirement(dependency)
if requirement.marker is None or requirement.marker.evaluate():
try:
@@ -304,7 +312,7 @@
# we need to re-start the entire process. Ask the user to do so.
print('Now, you have to re-execute the command to start your script.')
sys.exit(1)
-except ImportError as e: # raised in textlib
+except ImportError as e: # raised in textlib or backports
sys.exit(e)
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/987422
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: I0c46b5be772812a169de25d329ffb37ee628bab2
Gerrit-Change-Number: 987422
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged