My very basic project template I like to use when bootstrapping a new Python project that has some kind of CLI interface.
- A basic directory structure that allows us to run the project as a module with
python -m projectname - Flake8 linting (extended with
flake8-bugbear) - Black formatter
- Pytest framework
- VSCode configuration:
settings.jsonthat configures Python executable to.venv(create it yourself withpython -m venv .venv) and configurespytest,flake8andblack.launch.jsonwith configurations for debugging module and currently active file
Run tests either manually
pytestOr, let VSCode handle it by going to the test tab and running/debugging tests from there. VSCode will mark all failed tests with a red underline directly in the source code. Read more in VSCode docs.
Run linting either manually
flake8 projectname/VSCode is also configured to lint and format automatically on save.
