Skip to content

Commit

Permalink
Update ruff and associated changes (zarr-developers#2522)
Browse files Browse the repository at this point in the history
* Upgrade ruff to 0.8.1

Remove deprecated rules:
https://astral.sh/blog/ruff-v0.8.0#removal-of-six-deprecated-rules

* Apply ruff/flake8-pyi rule PYI061

PYI061 `Literal[None, ...]` can be replaced with `Literal[...] | None`
  • Loading branch information
DimitriPapadopoulos authored Dec 1, 2024
1 parent f8e3432 commit 90b3aea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
rev: v0.8.1
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -294,19 +294,14 @@ extend-select = [
"W", # pycodestyle warnings
]
ignore = [
"ANN101", # deprecated
"ANN102", # deprecated
"ANN401",
"PT004", # deprecated
"PT005", # deprecated
"PT011", # TODO: apply this rule
"PT012", # TODO: apply this rule
"RET505",
"RET506",
"RUF005",
"SIM108",
"TRY003",
"UP027", # deprecated
"UP038", # https://github.com/astral-sh/ruff/issues/7871
# https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"W191",
Expand Down
4 changes: 2 additions & 2 deletions src/zarr/core/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ async def from_store(
async def open(
cls,
store: StoreLike,
zarr_format: Literal[2, 3, None] = 3,
zarr_format: Literal[2, 3] | None = 3,
use_consolidated: bool | str | None = None,
) -> AsyncGroup:
"""Open a new AsyncGroup
Expand Down Expand Up @@ -1691,7 +1691,7 @@ def from_store(
def open(
cls,
store: StoreLike,
zarr_format: Literal[2, 3, None] = 3,
zarr_format: Literal[2, 3] | None = 3,
) -> Group:
"""Open a group from an initialized store.
Expand Down

0 comments on commit 90b3aea

Please sign in to comment.