My current setup for Python development fixes up the current file with black
on save. flake8
fixes are displayed inline with SublimeLinter
. isort
is tied to a Build System
that gets triggered when Command+B is pressed. Not the most elegant solution, but it works. The PyTest package is used to run tests on save and gives a red/green status bar output.
pip3 install --user black isort flake8 pytest
- Make sure that the Python3 bin directory is exported in your shell with something like
export PATH=${PATH}:/Users/<your username>/Library/Python/3.7/bin
in~/.bash_profile
- Add
"shell_cmd": "black --quiet $file && isort --quiet --atomic $file"
to a new Build System named "Python Formatter" - Add
"show_panel_on_build": false
to the User settings - Copy over the
project.sublime-settings
,.flake8
, and.editorconfig
files into the root of your project - Install the following packages: