Skip to content

Commit

Permalink
MAINT: autoupdate pre-commit hooks (#6)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Remco de Boer <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and redeboer authored Jan 12, 2024
1 parent e55fda8 commit a3af565
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 32 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
__pycache__/
benchmark-results/
condaenv.*.requirements.txt
node_modules/
41 changes: 21 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_schedule: quarterly # already done by requirements-cron.yml
skip:
- prettier
- pyright
- taplo

Expand All @@ -11,6 +12,19 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.2.0
hooks:
- id: colab-toc-visible
- id: check-dev-files
args:
- --no-github-actions
- --no-gitpod
- --no-prettierrc
- --no-pypi
- --no-ruff
- --repo-name=jax-mini-benchmark

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand All @@ -25,29 +39,16 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 23.9.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.12.1
hooks:
- id: black
- id: black-jupyter
args: [--line-length=85]
types_or: [jupyter]

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.1.0
hooks:
- id: colab-toc-visible
- id: check-dev-files
args:
- --no-github-actions
- --no-gitpod
- --no-prettierrc
- --no-pypi
- --no-ruff
- --repo-name=jax-mini-benchmark

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.7.2
rev: 2.7.3
hooks:
- id: editorconfig-checker
name: editorconfig
Expand All @@ -58,17 +59,17 @@ repos:
)$
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier

- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.330
rev: v1.1.345
hooks:
- id: pyright

Expand All @@ -80,7 +81,7 @@ repos:
- --py37-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.292
rev: v0.1.13
hooks:
- id: ruff
args:
Expand Down
4 changes: 3 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"eamodio.gitlens",
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"garaioag.garaio-vscode-unwanted-recommendations",
"github.vscode-pull-request-github",
"ms-python.black-formatter",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-keymap",
"ms-toolsai.jupyter-renderers",
"Soulcode.vscode-unwanted-extensions",
"stkb.rewrap",
"tamasfe.even-better-toml",
"tyriar.sort-lines",
Expand All @@ -19,10 +19,12 @@
"unwantedRecommendations": [
"bungcip.better-toml",
"davidanson.vscode-markdownlint",
"garaioag.garaio-vscode-unwanted-recommendations",
"ms-python.flake8",
"ms-python.isort",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"streetsidesoftware.code-spell-checker",
"travisillig.vscode-json-stable-stringify"
]
}
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [88]
},
"black-formatter.importStrategy": "fromEnvironment",
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"multiDiffEditor.experimental.enabled": true,
"python.analysis.typeCheckingMode": "strict",
"rewrap.wrappingColumn": 88,
"ruff.enable": true,
Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ dependencies:
- pip
- pip:
- -e .[dev]
variables:
PRETTIER_LEGACY_CLI: "1"
15 changes: 14 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,20 @@ name = "jax-mini-benchmark"
requires-python = ">=3.7"

[project.optional-dependencies]
dev = ["jax-mini-benchmark[sty]"]
dev = [
"jax-mini-benchmark[jupyter]",
"jax-mini-benchmark[sty]",
]
jupyter = [
"isort",
"jupyterlab",
"jupyterlab-code-formatter",
"jupyterlab-git",
"jupyterlab-lsp",
"jupyterlab-myst",
"python-lsp-ruff",
"python-lsp-server[rope]",
]
sty = [
"black",
"pre-commit",
Expand Down
16 changes: 7 additions & 9 deletions visualize-benchmark.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@
"source": [
"import pandas as pd\n",
"\n",
"df = pd.DataFrame(\n",
" {\n",
" k + 1: v.all_runs\n",
" for k, v in benchmarks.items()\n",
" if isinstance(k, int)\n",
" # if k % 2 == 0\n",
" # if k < 6\n",
" }\n",
")"
"df = pd.DataFrame({\n",
" k + 1: v.all_runs\n",
" for k, v in benchmarks.items()\n",
" if isinstance(k, int)\n",
" # if k % 2 == 0\n",
" # if k < 6\n",
"})"
]
},
{
Expand Down

0 comments on commit a3af565

Please sign in to comment.