2.1 KiB
Formatting
Black is recommended to format the Python files. It is a highly opinionated formatter that follows PEP8.
Typical Workflow
-
Add
blackpython library as dev dependency in the virtual environment. Pin down the version if necessary.=== "Poetry"
```bash poetry add -G dev black ```=== "Conda"
```bash conda install black ``` -
Install
Blackvscode extension as specified in Computer Setup -
Enable format on save in your editor
Additional settings
Black can be customized through pyproject.toml
Black settings are explained in here.
Linting
Ruff is recommended to lint the Python files.
Typical Workflow
-
Add
ruffpython library as dev dependency in the virtual environment. Pin down the version if necessary.=== "Poetry"
```bash poetry add -G dev ruff ```=== "Conda"
```bash conda install ruff ``` -
Install
Ruffvscode extension as specified in Computer Setup
Additional setting
Ruff can be customized through pyproject.toml
Ruff settings are explained in here.
Type checking
Pyright is recommended to type check all python files in the project.
Typical Worklow
-
Add
pyrightpython library as dev dependency in the virtual environment. Pin down the version if necessary.=== "Poetry"
```bash poetry add -G dev pyright ```=== "Conda"
```bash conda install pyright ``` -
Install
Pythonvscode extension as specified in Computer Setup
Additional setting
Pyright can be customized through pyproject.toml
Pyright settings are explained in here