jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1061098?usp=email )
Change subject: [IMPR] Add a hint to import missing module in wrapper.py
......................................................................
[IMPR] Add a hint to import missing module in wrapper.py
Change-Id: I4286cd234be63787a7988d9152a940f3bfdf070e
---
M pywikibot/scripts/wrapper.py
1 file changed, 4 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 71e7a0b..bba3591 100755
--- a/pywikibot/scripts/wrapper.py
+++ b/pywikibot/scripts/wrapper.py
@@ -314,8 +314,10 @@
# 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 or backports
- sys.exit(e)
+except ModuleNotFoundError as module: # raised in textlib or backports
+ print(f'\n{module.msg}\nPlease install it with\n\n'
+ f' pip install {module.name}')
+ sys.exit()
def find_alternates(filename, script_paths):
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1061098?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I4286cd234be63787a7988d9152a940f3bfdf070e
Gerrit-Change-Number: 1061098
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1061035?usp=email )
Change subject: [fix] check whether tile exists first
......................................................................
[fix] check whether tile exists first
This is a temporary solution for T372106.
FilePage.exists() gives True if the file decription exists even there
is no file at all but file_is_shared() fails with missing imageinfo
exception. We should have a way to check for existing image.
For this special case such files should be delinked.
Bug: T372106
Change-Id: Ieec85c7de50ba65433f2d9731aaf65316fb74c55
---
M scripts/delinker.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
Aram: Looks good to me, but someone else must approve
jenkins-bot: Verified
diff --git a/scripts/delinker.py b/scripts/delinker.py
index 13513ac..975d424 100755
--- a/scripts/delinker.py
+++ b/scripts/delinker.py
@@ -93,7 +93,7 @@
def skip_page(self, page) -> bool:
"""Skip pages which neither exists locally nor on shared repository."""
pywikibot.info('.', newline=False)
- if page.file_is_shared() or page.exists():
+ if page.exists() or page.file_is_shared():
return True
return super().skip_page(page)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1061035?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Ieec85c7de50ba65433f2d9731aaf65316fb74c55
Gerrit-Change-Number: 1061035
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Aram <arambakr1620(a)gmail.com>
Gerrit-Reviewer: D3r1ck01 <dalangi-ctr(a)wikimedia.org>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1060876?usp=email )
Change subject: [CI] run fasttest with pypy
......................................................................
[CI] run fasttest with pypy
use pypy3 as py39 base python because the current pypy3
bases on Python 3.9. This ensures that fasttest-py39 runs
with pypy.
Fix gui_tests because pypy3 has a tkinter module but this just
raises ImportError if _tkinter is not installed; require_modules
does not work here for tkinter.
Change-Id: I2640dd17f62d5d40b54d8e5cf1279661d094e302
---
M tests/gui_tests.py
M tox.ini
2 files changed, 12 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/tests/gui_tests.py b/tests/gui_tests.py
index 428ba2e..b1602af 100755
--- a/tests/gui_tests.py
+++ b/tests/gui_tests.py
@@ -55,7 +55,7 @@
self.assertIn('Main Page', text)
-@require_modules('tkinter', 'PIL')
+@require_modules('PIL')
def setUpModule():
"""Skip tests if tkinter or PIL is not installed.
@@ -67,7 +67,13 @@
'(set PYWIKIBOT_TEST_GUI=1 to enable)')
global EditBoxWindow, Tkdialog, tkinter
- import tkinter
+
+ # pypy3 has a tkinter module which just raises importError if _tkinter
+ # is not installed; thus require_modules does not work for it.
+ try:
+ import tkinter
+ except ImportError as e:
+ raise unittest.SkipTest(e)
from pywikibot.userinterfaces.gui import EditBoxWindow, Tkdialog
diff --git a/tox.ini b/tox.ini
index db19bcf..a021ec2 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,8 +5,8 @@
skip_missing_interpreters = True
envlist =
commit-message
- flake8-py{37,312,py}
- hacking-py{37,312,py}
+ flake8-py3{7,9,12}
+ hacking-py3{7,9,12}
[params]
# Note: tox 4 does not support multiple lines when doing parameters
@@ -14,10 +14,11 @@
generate_user_files = -W error::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v
[testenv]
+# pypy3 bases on Python 3.9
basepython =
py37: python3.7
py38: python3.8
- py39: python3.9
+ py39: pypy3
py310: python3.10
py311: python3.11
py312: python3.12
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1060876?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I2640dd17f62d5d40b54d8e5cf1279661d094e302
Gerrit-Change-Number: 1060876
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot