CyberPunkMetalHead / gateio-crypto-trading-bot-binance-announcements-new-coins

This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio
MIT License
1.21k stars 303 forks source link

Added GH actions using tox, pre-commit, black code formatting, flake8 #119

Closed Linus045 closed 2 years ago

Linus045 commented 2 years ago

I added GitHub Actions to automatically run the unit tests (currently 0) and also check code formatting with Flake8.

To get the tests to pass I reformatted all files accordingly. I also moved the source code into a subdirectory 'src/' and added a 'setup.py'/'setup.cfg' file to package the project as a module. This makes importing of files easier, especially for automated testing. I also added a pre-commit config so it will automatically validate all files with flake8 on commit and reformat the code using black.

I wrote all necessary instructions into the development_setup.md file.

Some changes i made might cause problems so please take care when code reviewing this. I tried to keep all commits seperate and small, so reviewing changes shouldn't take too long.

Currently mypy doesn't work correctly dues to typing problems. To fix those we need to explicitly define types for variables e.g. myDict : Dict[str, str] = {} utilising the 'typing' module.

Linus045 commented 2 years ago

I reverted/ignored commit 2340b957410e0f33003 when merging the new changes. Therefore the config.yaml and auth.yaml is expected to be in the <root> and <root>/auth directory again instead of <root>/src/.

The bot should be run from the root directory using the main.py (<root>/main.py) also located in the root directory (NOT <root>/src/gateio_new_coins_announcements_bot/main.py).