Skip to content

Commit

Permalink
DX: install Ruff and Git in Jupyter Lab (#87)
Browse files Browse the repository at this point in the history
* MAINT: update pip constraints and pre-commit

---------

Co-authored-by: GitHub <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Dec 2, 2023
1 parent e511390 commit c3d6846
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 35 deletions.
10 changes: 10 additions & 0 deletions .constraints/py3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ beautifulsoup4==4.12.2
black==23.11.0
bleach==6.1.0
cachetools==5.3.2
cattrs==23.2.3
certifi==2023.11.17
cffi==1.16.0
cfgv==3.4.0
Expand Down Expand Up @@ -49,6 +50,8 @@ flatbuffers==23.5.26
fonttools==4.46.0
fqdn==1.5.1
gast==0.5.4
gitdb==4.0.11
gitpython==3.1.40
google-auth==2.24.0
google-auth-oauthlib==1.1.0
google-pasta==0.2.0
Expand All @@ -69,6 +72,7 @@ ipython==8.18.1
ipython-genutils==0.2.0
ipywidgets==8.1.1
isoduration==20.11.0
isort==5.12.0
jax==0.4.20
jaxlib==0.4.20
jedi==0.19.1
Expand All @@ -83,9 +87,11 @@ jupyter-core==5.5.0
jupyter-events==0.9.0
jupyter-lsp==2.2.1
jupyter-server==2.11.1
jupyter-server-mathjax==0.2.6
jupyter-server-terminals==0.4.4
jupyterlab==4.0.9
jupyterlab-code-formatter==2.2.1
jupyterlab-git==0.50.0
jupyterlab-lsp==5.0.1
jupyterlab-myst==2.1.0
jupyterlab-pygments==0.3.0
Expand All @@ -96,6 +102,7 @@ kiwisolver==1.4.5
latexcodec==2.0.1
libclang==16.0.6
livereload==2.6.3
lsprotocol==2023.0.0
markdown==3.5.1
markdown-it-py==3.0.0
markupsafe==2.1.3
Expand All @@ -111,6 +118,7 @@ myst-nb==1.0.0
myst-parser==2.0.0
nbclient==0.6.8
nbconvert==7.11.0
nbdime==4.0.1
nbformat==5.9.2
nbmake==1.4.6
nest-asyncio==1.5.8
Expand Down Expand Up @@ -153,6 +161,7 @@ python-constraint==1.4.0
python-dateutil==2.8.2
python-json-logger==2.0.7
python-lsp-jsonrpc==1.1.2
python-lsp-ruff==2.0.0
python-lsp-server==1.9.0
pytoolconfig==1.2.6
pyyaml==6.0.1
Expand All @@ -170,6 +179,7 @@ ruff==0.1.6
scipy==1.11.4
send2trash==1.8.2
six==1.16.0
smmap==5.0.1
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.5
Expand Down
10 changes: 10 additions & 0 deletions .constraints/py3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ beautifulsoup4==4.12.2
black==23.11.0
bleach==6.1.0
cachetools==5.3.2
cattrs==23.2.3
certifi==2023.11.17
cffi==1.16.0
cfgv==3.4.0
Expand Down Expand Up @@ -48,6 +49,8 @@ flatbuffers==23.5.26
fonttools==4.46.0
fqdn==1.5.1
gast==0.5.4
gitdb==4.0.11
gitpython==3.1.40
google-auth==2.24.0
google-auth-oauthlib==1.1.0
google-pasta==0.2.0
Expand All @@ -68,6 +71,7 @@ ipython==8.18.1
ipython-genutils==0.2.0
ipywidgets==8.1.1
isoduration==20.11.0
isort==5.12.0
jax==0.4.20
jaxlib==0.4.20
jedi==0.19.1
Expand All @@ -82,9 +86,11 @@ jupyter-core==5.5.0
jupyter-events==0.9.0
jupyter-lsp==2.2.1
jupyter-server==2.11.1
jupyter-server-mathjax==0.2.6
jupyter-server-terminals==0.4.4
jupyterlab==4.0.9
jupyterlab-code-formatter==2.2.1
jupyterlab-git==0.50.0
jupyterlab-lsp==5.0.1
jupyterlab-myst==2.1.0
jupyterlab-pygments==0.3.0
Expand All @@ -95,6 +101,7 @@ kiwisolver==1.4.5
latexcodec==2.0.1
libclang==16.0.6
livereload==2.6.3
lsprotocol==2023.0.0
markdown==3.5.1
markdown-it-py==3.0.0
markupsafe==2.1.3
Expand All @@ -110,6 +117,7 @@ myst-nb==1.0.0
myst-parser==2.0.0
nbclient==0.6.8
nbconvert==7.11.0
nbdime==4.0.1
nbformat==5.9.2
nbmake==1.4.6
nest-asyncio==1.5.8
Expand Down Expand Up @@ -152,6 +160,7 @@ python-constraint==1.4.0
python-dateutil==2.8.2
python-json-logger==2.0.7
python-lsp-jsonrpc==1.1.2
python-lsp-ruff==2.0.0
python-lsp-server==1.9.0
pytoolconfig==1.2.6
pyyaml==6.0.1
Expand All @@ -169,6 +178,7 @@ ruff==0.1.6
scipy==1.11.4
send2trash==1.8.2
six==1.16.0
smmap==5.0.1
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.5
Expand Down
10 changes: 10 additions & 0 deletions .constraints/py3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ beautifulsoup4==4.12.2
black==23.11.0
bleach==6.1.0
cachetools==5.3.2
cattrs==23.2.3
certifi==2023.11.17
cffi==1.16.0
cfgv==3.4.0
Expand Down Expand Up @@ -50,6 +51,8 @@ flatbuffers==23.5.26
fonttools==4.46.0
fqdn==1.5.1
gast==0.4.0
gitdb==4.0.11
gitpython==3.1.40
google-auth==2.24.0
google-auth-oauthlib==1.0.0
google-pasta==0.2.0
Expand All @@ -71,6 +74,7 @@ ipython==8.12.3
ipython-genutils==0.2.0
ipywidgets==8.1.1
isoduration==20.11.0
isort==5.12.0
jax==0.4.13
jaxlib==0.4.13
jedi==0.19.1
Expand All @@ -85,9 +89,11 @@ jupyter-core==5.5.0
jupyter-events==0.9.0
jupyter-lsp==2.2.1
jupyter-server==2.11.1
jupyter-server-mathjax==0.2.6
jupyter-server-terminals==0.4.4
jupyterlab==4.0.9
jupyterlab-code-formatter==2.2.1
jupyterlab-git==0.50.0
jupyterlab-lsp==5.0.1
jupyterlab-myst==2.1.0
jupyterlab-pygments==0.3.0
Expand All @@ -98,6 +104,7 @@ kiwisolver==1.4.5
latexcodec==2.0.1
libclang==16.0.6
livereload==2.6.3
lsprotocol==2023.0.0
markdown==3.5.1
markdown-it-py==2.2.0
markupsafe==2.1.3
Expand All @@ -113,6 +120,7 @@ myst-nb==0.17.2
myst-parser==0.18.1
nbclient==0.6.8
nbconvert==7.11.0
nbdime==4.0.1
nbformat==5.9.2
nbmake==1.4.6
nest-asyncio==1.5.8
Expand Down Expand Up @@ -157,6 +165,7 @@ python-constraint==1.4.0
python-dateutil==2.8.2
python-json-logger==2.0.7
python-lsp-jsonrpc==1.1.2
python-lsp-ruff==2.0.0
python-lsp-server==1.9.0
pytoolconfig==1.2.6
pytz==2023.3.post1
Expand All @@ -175,6 +184,7 @@ ruff==0.1.6
scipy==1.10.1
send2trash==1.8.2
six==1.16.0
smmap==5.0.1
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.5
Expand Down
10 changes: 10 additions & 0 deletions .constraints/py3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ beautifulsoup4==4.12.2
black==23.11.0
bleach==6.1.0
cachetools==5.3.2
cattrs==23.2.3
certifi==2023.11.17
cffi==1.16.0
cfgv==3.4.0
Expand Down Expand Up @@ -49,6 +50,8 @@ flatbuffers==23.5.26
fonttools==4.46.0
fqdn==1.5.1
gast==0.5.4
gitdb==4.0.11
gitpython==3.1.40
google-auth==2.24.0
google-auth-oauthlib==1.1.0
google-pasta==0.2.0
Expand All @@ -70,6 +73,7 @@ ipython==8.18.1
ipython-genutils==0.2.0
ipywidgets==8.1.1
isoduration==20.11.0
isort==5.12.0
jax==0.4.20
jaxlib==0.4.20
jedi==0.19.1
Expand All @@ -84,9 +88,11 @@ jupyter-core==5.5.0
jupyter-events==0.9.0
jupyter-lsp==2.2.1
jupyter-server==2.11.1
jupyter-server-mathjax==0.2.6
jupyter-server-terminals==0.4.4
jupyterlab==4.0.9
jupyterlab-code-formatter==2.2.1
jupyterlab-git==0.50.0
jupyterlab-lsp==5.0.1
jupyterlab-myst==2.1.0
jupyterlab-pygments==0.3.0
Expand All @@ -97,6 +103,7 @@ kiwisolver==1.4.5
latexcodec==2.0.1
libclang==16.0.6
livereload==2.6.3
lsprotocol==2023.0.0
markdown==3.5.1
markdown-it-py==3.0.0
markupsafe==2.1.3
Expand All @@ -112,6 +119,7 @@ myst-nb==1.0.0
myst-parser==2.0.0
nbclient==0.6.8
nbconvert==7.11.0
nbdime==4.0.1
nbformat==5.9.2
nbmake==1.4.6
nest-asyncio==1.5.8
Expand Down Expand Up @@ -154,6 +162,7 @@ python-constraint==1.4.0
python-dateutil==2.8.2
python-json-logger==2.0.7
python-lsp-jsonrpc==1.1.2
python-lsp-ruff==2.0.0
python-lsp-server==1.9.0
pytoolconfig==1.2.6
pyyaml==6.0.1
Expand All @@ -171,6 +180,7 @@ ruff==0.1.6
scipy==1.11.4
send2trash==1.8.2
six==1.16.0
smmap==5.0.1
sniffio==1.3.0
snowballstemmer==2.2.0
soupsieve==2.5
Expand Down
23 changes: 3 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.1.4
rev: 0.1.6
hooks:
- id: check-dev-files
args:
Expand All @@ -39,16 +39,6 @@ repos:
- --repo-title=AmpForm-DPD
- id: colab-toc-visible

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
hooks:
- id: nbqa-pyupgrade
args:
- --py38-plus
- id: nbqa-ruff
args:
- --fix

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
hooks:
Expand Down Expand Up @@ -108,19 +98,12 @@ repos:
hooks:
- id: pyright

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py38-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args:
- --fix
args: [--fix]
types_or: [python, pyi, jupyter]

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.1
Expand Down
37 changes: 22 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,14 @@ jax = [
]
jupyter = [
"ampform-dpd[doc]",
"isort",
"jupyterlab >=3.0",
"jupyterlab",
"jupyterlab-code-formatter",
"jupyterlab-git",
"jupyterlab-lsp",
"jupyterlab-myst",
"python-lsp-ruff",
"python-lsp-server[rope]",
]
lint = [
Expand Down Expand Up @@ -151,21 +155,6 @@ target-version = [
"py39",
]

[tool.nbqa.addopts]
ruff = [
"--extend-ignore=B018",
"--extend-ignore=C90",
"--extend-ignore=D",
"--extend-ignore=N806",
"--extend-ignore=N816",
"--extend-ignore=PLR09",
"--extend-ignore=PLR2004",
"--extend-ignore=PLW0602",
"--extend-ignore=PLW0603",
"--extend-ignore=PLW2901",
"--line-length=85",
]

[tool.pyright]
reportGeneralTypeIssues = false
reportImportCycles = false
Expand Down Expand Up @@ -214,6 +203,7 @@ testpaths = [
]

[tool.ruff]
extend-include = ["*.ipynb"]
extend-select = [
"A",
"B",
Expand Down Expand Up @@ -287,6 +277,23 @@ ignore-names = [

[tool.ruff.per-file-ignores]
"*" = ["D"]
"*.ipynb" = [
"B018",
"C90",
"D",
"E402",
"E703",
"N806",
"N816",
"PLR09",
"PLR2004",
"PLW0602",
"PLW0603",
"PLW2901",
"S101",
"T201",
"TCH00",
]
"docs/*" = [
"E402",
"INP001",
Expand Down

0 comments on commit c3d6846

Please sign in to comment.