From f66253819ee5aa551118ffd6732337784c46a012 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 18:54:39 +0100 Subject: [PATCH] MAINT: autoupdate pre-commit hooks (#48) 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> --- .cspell.json | 8 ++++++- .gitpod.yml | 3 ++- .pre-commit-config.yaml | 50 ++++++++++++++++++----------------------- .readthedocs.yml | 14 +++++++----- .vscode/extensions.json | 3 ++- .vscode/settings.json | 4 +++- docs/conf.py | 13 +++++------ environment.yml | 2 ++ pyproject.toml | 1 + setup.cfg | 11 ++++++--- 10 files changed, 61 insertions(+), 48 deletions(-) diff --git a/.cspell.json b/.cspell.json index 0a913e4..d95c25e 100644 --- a/.cspell.json +++ b/.cspell.json @@ -1,6 +1,11 @@ { "version": "0.2", - "enableFiletypes": ["git-commit", "julia", "jupyter"], + "enableFiletypes": [ + "git-commit", + "github-actions-workflow", + "julia", + "jupyter" + ], "flagWords": [ "analyse", "colour", @@ -16,6 +21,7 @@ ], "ignorePaths": [ "**/*.bib", + "**/*.rst_t", "**/.cspell.json", ".editorconfig", ".gitignore", diff --git a/.gitpod.yml b/.gitpod.yml index 360912b..9d8eb2b 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,4 +1,5 @@ tasks: + - init: pyenv local 3.8 - init: pip install -e .[dev] github: @@ -19,13 +20,13 @@ vscode: - editorconfig.editorconfig - esbenp.prettier-vscode - executablebookproject.myst-highlight - - garaioag.garaio-vscode-unwanted-recommendations - github.vscode-github-actions - github.vscode-pull-request-github - ms-python.black-formatter - ms-python.python - ms-vscode.live-server - redhat.vscode-yaml + - Soulcode.vscode-unwanted-extensions - stkb.rewrap - streetsidesoftware.code-spell-checker - tamasfe.even-better-toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3c71059..b376c54 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 skip: + - prettier - pyright - taplo @@ -11,6 +12,20 @@ repos: - id: check-hooks-apply - id: check-useless-excludes + - repo: https://github.com/ComPWA/policy + rev: 0.2.0 + hooks: + - id: check-dev-files + args: + - --allow-labels + - --ignore-author + - --keep-issue-templates + - --no-notebooks + - --no-prettierrc + - --repo-name=bossdoc + - --repo-title=BOSS Documentation + - id: format-setup-cfg + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: @@ -31,32 +46,18 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - - repo: https://github.com/ComPWA/repo-maintenance - rev: 0.1.0 - hooks: - - id: check-dev-files - args: - - --allow-labels - - --ignore-author - - --keep-issue-templates - - --no-notebooks - - --no-prettierrc - - --repo-name=bossdoc - - --repo-title=BOSS Documentation - - id: format-setup-cfg - - - 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 - repo: https://github.com/streetsidesoftware/cspell-cli - rev: v7.3.1 + rev: v8.3.0 hooks: - id: cspell - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: 2.7.2 + rev: 2.7.3 hooks: - id: editorconfig-checker name: editorconfig @@ -67,24 +68,17 @@ repos: )$ - 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 - - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 - hooks: - - id: pyupgrade - args: - - --py36-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/.readthedocs.yml b/.readthedocs.yml index 0d45094..97340e8 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -3,13 +3,15 @@ version: 2 sphinx: builder: html configuration: docs/conf.py - fail_on_warning: false + fail_on_warning: true formats: - htmlzip -python: - version: 3.8 - install: - - method: pip - path: . +build: + os: ubuntu-22.04 + tools: + python: "3.8" + jobs: + post_install: + - pip install -e .[doc] diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3d7ca2b..f727ac4 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -6,13 +6,13 @@ "editorconfig.editorconfig", "esbenp.prettier-vscode", "executablebookproject.myst-highlight", - "garaioag.garaio-vscode-unwanted-recommendations", "github.vscode-github-actions", "github.vscode-pull-request-github", "ms-python.black-formatter", "ms-python.python", "ms-vscode.live-server", "redhat.vscode-yaml", + "Soulcode.vscode-unwanted-extensions", "stkb.rewrap", "streetsidesoftware.code-spell-checker", "tamasfe.even-better-toml", @@ -22,6 +22,7 @@ "unwantedRecommendations": [ "bungcip.better-toml", "davidanson.vscode-markdownlint", + "garaioag.garaio-vscode-unwanted-recommendations", "ms-python.flake8", "ms-python.isort", "ms-python.mypy-type-checker", diff --git a/.vscode/settings.json b/.vscode/settings.json index 555da2d..a89a211 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,7 +20,7 @@ }, "[python]": { "editor.codeActionsOnSave": { - "source.organizeImports": true + "source.organizeImports": "explicit" }, "editor.defaultFormatter": "ms-python.black-formatter", "editor.rulers": [88] @@ -30,6 +30,7 @@ }, "black-formatter.importStrategy": "fromEnvironment", "cSpell.enabled": true, + "diffEditor.experimental.showMoves": true, "editor.formatOnSave": true, "files.watcherExclude": { "**/*_cache/**": true, @@ -40,6 +41,7 @@ "git.rebaseWhenSync": true, "github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"], "livePreview.defaultPreviewPath": "docs/_build/html", + "multiDiffEditor.experimental.enabled": true, "python.testing.pytestArgs": ["--color=no", "--no-cov"], "python.testing.pytestEnabled": false, "python.testing.unittestEnabled": false, diff --git a/docs/conf.py b/docs/conf.py index 570c306..7d091a8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -96,12 +96,10 @@ def fetch_logo(url: str, output_path: str) -> None: "members": True, "undoc-members": True, "show-inheritance": True, - "special-members": ", ".join( - [ - "__call__", - "__eq__", - ] - ), + "special-members": ", ".join([ + "__call__", + "__eq__", + ]), } graphviz_output_format = "svg" html_copy_source = True # needed for download notebook button @@ -142,7 +140,7 @@ def fetch_logo(url: str, output_path: str) -> None: # Intersphinx settings intersphinx_mapping = { - "compwa-org": ("https://compwa-org.readthedocs.io/en/stable", None), + "compwa-org": ("https://compwa-org.readthedocs.io", None), } # Settings for autosectionlabel @@ -162,6 +160,7 @@ def fetch_logo(url: str, output_path: str) -> None: linkcheck_anchors = False linkcheck_ignore = [ "http://code.ihep.ac.cn/redeboer/IniSelect", + "http://www.cmtsite.net", "https://github.com/redeboer/BOSS_IniSelect_ORIGINAL", "https://scientificlinux.org", r"http://[A-Za-z0-9]+\.ihep\.ac\.cn", diff --git a/environment.yml b/environment.yml index 6f4f746..a4e0365 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 72b8383..2181c50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -120,6 +120,7 @@ task-tags = ["cspell"] "docs/conf.py" = [ "A00", "B006", + "D100", "PLR0913", ] "setup.py" = ["D100"] diff --git a/setup.cfg b/setup.cfg index dabdcd3..1eaf48c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -38,7 +38,9 @@ classifiers = python_requires = >=3.6 setup_requires = setuptools_scm -install_requires = + +[options.extras_require] +doc = ipywidgets jupyter matplotlib @@ -53,8 +55,6 @@ install_requires = sphinx-togglebutton sphinxcontrib-bibtex >=2 sphobjinv - -[options.extras_require] format = black lint = @@ -62,8 +62,13 @@ lint = sty = %(format)s %(lint)s + docutils pre-commit >=1.4.0 + pybtex + requests + Sphinx dev = + %(doc)s %(sty)s jupyterlab jupyterlab-code-formatter