MikaLendingBot
MikaLendingBot copied to clipboard
Python 3 support and unit tests
Add support for python 3 (Only tested on 3.6 so far)
Description
Python 2 will eventually be discontinued. Also this allows for async and other functionality eventually if we ever move off 2.7
Unit tests were needed anyway, so I thought this was a good chance to add them to each module.
I've ported all the code (I think) to python 3, whilst still supporting python 2. There are still a lot of tests to write however to check it's working.
So far I've about half of Configuration done, MarketAnalysis was already done.
Opening this now for visibility in case anyone has comments or wants to help out.
You can run the test with
pytest -v
TESTING STAGE
Currently running this branch and testing.
Types of changes
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
- [x] I have read CONTRIBUTING.md
- [x] I fully understand Github Flow.
- [x] My code adheres to the code style of this project.
- [N/A] I have updated the documentation in /docs if I have changed the config, arguments, logic in how the bot works, or anything that understandably needs a documentation change.
- [N/A] I have updated the config file accordingly if my change requires a new configuration setting or changes an existing one.
- [ ] I have tested the bot with no issues for 24 continuous hours. If issues were experienced, they have been patched and tested again.
@laxdog Testing is always appreciated. Is this still on your radar? If not, we should consider this PR stale and close it out...
@laxdog if I fix conflicts, is this at least stable enough to merge? I am looking to starting a major overhaul which needs Python 3 around the end of this month.
@bkuhl @Evanito I'll pick it up again this week and let you know what the state is.
Been meaning to get back into this project for a while now, so this is a good stepping off point.
I'm going to redo it. There are a few things I wasn't aware of or weren't available when I started it last time.
Don't delete the branch just yet, I still want to compare code from it.
I'm assuming here we're dropping python2 support if you're wanting something from 3 @Evanito ?
I'm happy to do that and it makes it much cleaner if so, just checking before I rewrite a lot of this.
I'm excited to see some renewed interest in this. 900 stars is quite the achievement. Keep it going!
@laxdog Yes, async in particular. 👍 Since this will be breaking backwards compatibility, merge this into the dev branch instead of master. So users only have to manually switch once at a later time.
First pass : https://github.com/BitBotFactory/MikaLendingBot/tree/python36
What branch do you want this PR raised against @Evanito ?
@laxdog python36 Going to put all the breaking changes on there so once it only breaks for users once.
Is this branch working? Python2 will lose support soon and it's very urgent to update to Python 3.