From 11e36d7134f5b54ce637596e0c0f332581b884b2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 16:05:09 -0400 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#268) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.5.0](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.4...v0.5.0) - [github.com/adamchainz/blacken-docs: 1.16.0 → 1.18.0](https://github.com/adamchainz/blacken-docs/compare/1.16.0...1.18.0) - [github.com/tox-dev/pyproject-fmt: 2.0.4 → 2.1.3](https://github.com/tox-dev/pyproject-fmt/compare/2.0.4...2.1.3) * Update Pyproject formatting * Reformat remove 3.9 upstream tests * Add new Zarr requirement * More new Zarr requirements * Gahh, even more new Zarr requirements * Remove Zarr from upstream tests and pin to less than 3 * Fully remove upstream Zarr line --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alex Kerney --- .github/workflows/main.yaml | 4 +- .pre-commit-config.yaml | 6 +-- pyproject.toml | 77 +++++++++++++++---------------------- 3 files changed, 37 insertions(+), 50 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 66cab44..501ee83 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12"] pydantic-version: ["<2", ">=2"] steps: - uses: actions/checkout@v4 @@ -56,7 +56,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 11f7121..9f397bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -10,7 +10,7 @@ repos: - id: double-quote-string-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.4" + rev: "v0.5.0" hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -23,7 +23,7 @@ repos: - mdformat-myst - repo: https://github.com/adamchainz/blacken-docs - rev: "1.16.0" + rev: "1.18.0" hooks: - id: blacken-docs additional_dependencies: @@ -43,7 +43,7 @@ repos: - markdown # managed by mdformat - repo: https://github.com/tox-dev/pyproject-fmt - rev: "2.0.4" + rev: "2.1.3" hooks: - id: pyproject-fmt diff --git a/pyproject.toml b/pyproject.toml index 41ebb9a..39ee756 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,58 +65,57 @@ skip-string-normalization = true [tool.ruff] line-length = 100 -[tool.ruff.lint] -select = [ +lint.select = [ "B", # flake8-bugbear - "C", - 'D', # pydocstyle - "E", # pycodestyle - "F", # Pyflakes - "I", # isort - "W", # pycodestyle # "T4", "B9", + "C", + "D", # pydocstyle + "E", # pycodestyle + "F", # Pyflakes + "I", # isort + "W", # pycodestyle ] -ignore = [ +lint.ignore = [ + "C901", "D100", # Missing docstring in public module - "D107", # Missing docstring in `__init__` "D104", # Missing docstring in public package "D105", # Missing docstring in magic method + "D107", # Missing docstring in `__init__` + "E402", # "E203", # "E266", "E501", # "W503", "E722", - "E402", - "C901", ] -exclude = [ - "tests/", +lint.exclude = [ "docs/", + "tests/", ] - -[tool.ruff.lint.per-file-ignores] -"tests/*" = [ +lint.per-file-ignores."docs/*" = [ + "D101", # missing docstring in public class + "D102", # missing docstring in public method + "D103", # missing docstring in public function +] +lint.per-file-ignores."tests/*" = [ "D103", # Missing docstring in public function "D205", # blank line between summary and description "D415", # first line should end with punctuation ] -"docs/*" = [ - "D101", # missing docstring in public class - "D102", # missing docstring in public method - "D103", # missing docstring in public function +# Allow fastapi.Depends and other dependency injection style function arguments +lint.flake8-bugbear.extend-immutable-calls = [ + "fastapi.Depends", + "fastapi.Path", + "fastapi.Query", ] - -[tool.ruff.lint.mccabe] -# Unlike Flake8, default to a complexity level of 10. -max-complexity = 18 - -[tool.ruff.lint.isort] -combine-as-imports = true -known-first-party = [ +lint.flake8-quotes.docstring-quotes = "double" +lint.flake8-quotes.inline-quotes = "single" +lint.isort.combine-as-imports = true +lint.isort.known-first-party = [ "xpublish", ] -known-third-party = [ +lint.isort.known-third-party = [ "cachey", "dask", "fastapi", @@ -134,22 +133,10 @@ known-third-party = [ "xarray", "zarr", ] - -[tool.ruff.lint.pydocstyle] +# Unlike Flake8, default to a complexity level of 10. +lint.mccabe.max-complexity = 18 # Use Google style docstrings -convention = "google" - -[tool.ruff.lint.flake8-quotes] -inline-quotes = "single" -docstring-quotes = "double" - -[tool.ruff.lint.flake8-bugbear] -# Allow fastapi.Depends and other dependency injection style function arguments -extend-immutable-calls = [ - "fastapi.Depends", - "fastapi.Query", - "fastapi.Path", -] +lint.pydocstyle.convention = "google" [tool.pytest.ini_options] log_cli = true