rmmh / skybot

Python IRC bot
https://github.com/rmmh/skybot/wiki
The Unlicense
249 stars 170 forks source link

Upgrade to Python 3? #175

Closed imnotjames closed 5 years ago

imnotjames commented 6 years ago

I wanted to open an issue to discuss what concerns there are - if any - on upgrading to Python 3 from 2.7. At the very least, I'd be interested in trying to get python 3 compatible code up with future but there are no Python2-only dependencies, so I'm using Python 3 live.

I've already done a quick pass for the fork of skybot that I keep up, but it's always nice to push things back upstream. ( https://github.com/imnotjames/skybot/commit/960e8b6e1256f1d9d9f7011cd71433217815a966 )

I hit a few problems:

Would there be interest in merging these changes upstream?

rmmh commented 6 years ago

I'm open to this. It's time to do the migration.

A few plugins have tests, but not many. I prefer tests in the same file as plugins for simplicity, which works fine with nosetests, and could probably be made to work with tox as well. Some simple http mocking would probably work to expand testing.

Skybot mostly treats everything as utf-8, and we should be able to move to standard strings in Python 3. The unicode conversions should mostly happen at the core/irc.py layer with the network protocol, and be transparent otherwise.

imnotjames commented 6 years ago

I've opened a pull request with migration between 2 and 3 - https://github.com/rmmh/skybot/pull/190

It allows skybot to run both 2 and 3 and has tox set up to test 2.7 and 3.7

rmmh commented 5 years ago

Merged, thanks!