|Open||None||T152961 Improve tests suite|
|Open||None||T186323 Travis and Appveyor: Major improvement to test time|
|Open||None||T265640 phe-tools: Match&Split bot is not running because of python2 deprecation in pywikibot|
|Resolved||Xqt||T213287 Drop support of Python 2.7|
|Resolved||Xqt||T242120 Python 2 to 3 support request|
|Resolved||Xqt||T216018 Add python3 support for stewardbots|
|Resolved||Xqt||T216020 Add python3 support for SULWatcher|
Hi @Xqt - thanks for the patch!
I'm testing it and it looks like it's not working though. I keep seeing:
python3 /data/project/stewardbots/SULWatcher/SULWatcher.py Traceback (most recent call last): File "/data/project/stewardbots/SULWatcher/SULWatcher.py", line 22, in <module> from ircbot import SingleServerIRCBot ImportError: No module named 'ircbot'
What do you think this might be?
Done. The ircbot and irclib is extremely outdated 0.6.3 (2012) or earlier. Now we have 18.0. You have to install the package first. Python 3.6 is needed for the newest release. For older Pythons the right version will be installed with pip install irc.
It depends from where is Python and its side package is installed. If the steward bots have their own Python environment pip install <package> will be enough. Try pip list or pip freeze to show the current installation
It looks like the bot is started on the job grid using jstart -N stewardbot -mem 2G /data/project/stewardbots/venv/bin/python2.7 /data/project/stewardbots/StewardBot/StewardBot.py, so the virtual environment that you need to run pip from is /data/project/stewardbots/venv. It is all python2 right now, so if you are going to try a python3 deployment you will need a new venv. Something like python3 -mvenv $HOME/venv-py3 would make you a new one.
Sorry I am not familiar with neither venv nor tool lab. The migrated scripts may run with both, Python 2.7 and 3.4+. Both need the irc package. The package version depends on the Python version installed but is selected automatically via pip. The newest irc lib needs Python 3.6.
Traceback (most recent call last): File "/data/project/stewardbots/SULWatcher/SULWatcher.py", line 22, in <module> from irc.client import nm_to_n ImportError: cannot import name 'nm_to_n'
(venv-py3) tools.stewardbots@tools-sgebastion-07:~$ pip freeze importlib-metadata==1.4.0 importlib-resources==1.0.2 inflect==3.0.2 irc==17.1 jaraco.classes==2.0 jaraco.collections==2.1 jaraco.functools==2.0 jaraco.itertools==4.4.2 jaraco.logging==2.0 jaraco.stream==2.0 jaraco.text==3.2.0 more-itertools==8.1.0 pkg-resources==0.0.0 PyMySQL==0.9.3 pytz==2019.3 six==1.14.0 tempora==1.14.1 zipp==1.0.0
I'd assume not, as the whole point of the migration is that python2 shouldn't be used anymore. Python 2 should fail explicitly and quickly so we know that everything's actually been migrated properly.
Yes. I found a hint in the irc history that some methods are changed to property attributes 
The others are to be checked too.
 https://python-irc.readthedocs.io/en/latest/history.html Version 5.0
@Melos r/569355 didn't worked :-( Would it be possible to arrange some sort of live debugging on IRC one of this days to take a look at what's going on? Thanks!
It is working now after changing a database row. Let's keep this open for a while and see if it crashes (logs are sent together at sulwatcher.out) and if everything runs as expected, we can call this task resolved :-)