MikaLendingBot icon indicating copy to clipboard operation
MikaLendingBot copied to clipboard

Python 3 support and unit tests

Open laxdog opened this issue 7 years ago • 11 comments

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 avatar Sep 26 '17 10:09 laxdog

@laxdog Testing is always appreciated. Is this still on your radar? If not, we should consider this PR stale and close it out...

bkuhl avatar Apr 25 '18 00:04 bkuhl

@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.

Evanito avatar May 23 '18 02:05 Evanito

@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.

laxdog avatar May 23 '18 09:05 laxdog

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.

laxdog avatar May 23 '18 22:05 laxdog

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.

laxdog avatar May 23 '18 22:05 laxdog

I'm excited to see some renewed interest in this. 900 stars is quite the achievement. Keep it going!

bkuhl avatar May 23 '18 23:05 bkuhl

@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.

Evanito avatar May 23 '18 23:05 Evanito

First pass : https://github.com/BitBotFactory/MikaLendingBot/tree/python36

laxdog avatar May 24 '18 08:05 laxdog

What branch do you want this PR raised against @Evanito ?

laxdog avatar Jun 05 '18 22:06 laxdog

@laxdog python36 Going to put all the breaking changes on there so once it only breaks for users once.

Evanito avatar Jun 05 '18 22:06 Evanito

Is this branch working? Python2 will lose support soon and it's very urgent to update to Python 3.

wernersbacher avatar Dec 04 '19 08:12 wernersbacher