Skip to content

Instantly share code, notes, and snippets.

@agoose77
Last active August 30, 2025 12:52
Show Gist options
  • Save agoose77/9cb87496bd7923afdc28980b8b58a775 to your computer and use it in GitHub Desktop.
Save agoose77/9cb87496bd7923afdc28980b8b58a775 to your computer and use it in GitHub Desktop.
Launch JupyterLab with basic LSP support
[flake8]
# Match black
max-line-length = 88
# Allow asymmetric commas, etc.
extend-ignore =
E203,
# Spurious warnings in JupyterLab for code cells that follow Markdown cells
E303
exclude = .git,__pycache__,build,dist,.venv
max-complexity = 10

JupyterLab linting example

Binder

See overrides.json for user-settings under @jupyter-lsp/jupyterlab-lsp:plugin. This can be installed / linked into <sys-prefix>/share/jupyter/lab/settings

Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"@jupyter-lsp/jupyterlab-lsp:plugin": {
"language_servers": {
"pylsp": {
"priority": 100,
"serverSettings": {
"pylsp.plugins.flake8.config": ".flake8",
"pylsp.plugins.flake8.enabled": true,
"pylsp.plugins.pycodestyle.enabled": false,
"pylsp.plugins.pydocstyle.enabled": false,
"pylsp.plugins.pyflakes.enabled": false,
"pylsp.plugins.pylint.enabled": false,
"pylsp.plugins.yapf.enabled": false
}
}
}
}
}
#!/usr/bin/env bash
set -eux
mkdir -p ${NB_PYTHON_PREFIX}/share/jupyter/lab/settings
cp ./overrides.json ${NB_PYTHON_PREFIX}/share/jupyter/lab/settings
jupyterlab
python-lsp-server[all]
jupyterlab-lsp
# Code formatting
jupyterlab-code-formatter
black
isort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment