2 Matching Annotations
- Jul 2021
After reading through PEP8, you may wonder if there is a way to automatically check and enforce these guidelines? Flake8 does exactly this, and a bit more. It works out of the box, and can be configured in case you want to change some specific settings.
Flake8 does PEP8 and a bit more
The goal of this tutorial is to describe Python development ecosystem.
- Install Python through pyenv (don't use python.org)
- Install dependencies with Poetry (miniconda3 is also fine for some cases)
- Write tests with pytest (default testing framework for Poetry)
- Check test coverage with pytest-cov plugin
- Use pre-commit for automatic checks before git commiting (for example, for automatic code refactoring)
- Lint your code with flake8 to easily find bugs (it is not as strict as pylint)
- Format your code with Black so that it looks the same in every project (is consistent)
- Sort imports with isort (so that they are nicely organised: standard library, third party, local)