From a3af565f2efee580777f574fc2a02f82cb1609cc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 12 Jan 2024 19:02:52 +0100 Subject: [PATCH] MAINT: autoupdate pre-commit hooks (#6) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Remco de Boer <29308176+redeboer@users.noreply.github.com> --- .gitignore | 1 + .pre-commit-config.yaml | 41 ++++++++++++++++++++------------------- .vscode/extensions.json | 4 +++- .vscode/settings.json | 4 +++- environment.yml | 2 ++ pyproject.toml | 15 +++++++++++++- visualize-benchmark.ipynb | 16 +++++++-------- 7 files changed, 51 insertions(+), 32 deletions(-) diff --git a/.gitignore b/.gitignore index f37590f..c5da25c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ __pycache__/ benchmark-results/ condaenv.*.requirements.txt +node_modules/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 548f120..6717d7d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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: @@ -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 @@ -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 @@ -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: diff --git a/.vscode/extensions.json b/.vscode/extensions.json index fbeb4b8..c2be5e4 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -3,7 +3,6 @@ "eamodio.gitlens", "editorconfig.editorconfig", "esbenp.prettier-vscode", - "garaioag.garaio-vscode-unwanted-recommendations", "github.vscode-pull-request-github", "ms-python.black-formatter", "ms-python.python", @@ -11,6 +10,7 @@ "ms-toolsai.jupyter", "ms-toolsai.jupyter-keymap", "ms-toolsai.jupyter-renderers", + "Soulcode.vscode-unwanted-extensions", "stkb.rewrap", "tamasfe.even-better-toml", "tyriar.sort-lines", @@ -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" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 4dc84f1..f7260e5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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, diff --git a/environment.yml b/environment.yml index be6cee9..3965a4b 100644 --- a/environment.yml +++ b/environment.yml @@ -6,3 +6,5 @@ dependencies: - pip - pip: - -e .[dev] +variables: + PRETTIER_LEGACY_CLI: "1" diff --git a/pyproject.toml b/pyproject.toml index 8f6782d..0856cc0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/visualize-benchmark.ipynb b/visualize-benchmark.ipynb index 7a2c888..c6d70b5 100644 --- a/visualize-benchmark.ipynb +++ b/visualize-benchmark.ipynb @@ -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", + "})" ] }, {