From 2a0bead292a47c40b2d9a41f533c33790bf03cb6 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 16 Jan 2025 19:10:27 +0100 Subject: [PATCH 1/4] pre-commit autoupdate --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f1f11e947..acd9fa040 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: check-yaml - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.6.9 + rev: v0.9.2 hooks: # Run the linter. - id: ruff From 4811bde5219317d2257117a15495a97aeb20ec9e Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 16 Jan 2025 19:11:27 +0100 Subject: [PATCH 2/4] Rule UP027 was removed from ruff 0.8.0 --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7ec3c85e9..ef3b918d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -215,8 +215,6 @@ ignore = [ "UP011", "UP015", "UP018", - # deprecated - "UP027", "SIM102", "SIM105", "SIM108", From 530d7d1c5968cf5ca7ca50e28f77fbfaa822fa82 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 16 Jan 2025 19:15:05 +0100 Subject: [PATCH 3/4] Enable flake8-implicit-str-concat rules ISC001 and ISC002 Starting with ruff 0.9.1, they are documented to be compatible with the ruff formatter, if they are both enabled. --- pyproject.toml | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ef3b918d6..d4d9f49f5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -236,8 +236,6 @@ ignore = [ "Q003", "COM812", "COM819", - "ISC001", - "ISC002", ] [tool.pytest.ini_options] From db11f1de6ca007993578014ecee667b8480d2e75 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Thu, 16 Jan 2025 19:23:44 +0100 Subject: [PATCH 4/4] Run `ruff format` --- fsspec/implementations/dbfs.py | 6 +++--- fsspec/implementations/tests/test_tar.py | 4 ++-- fsspec/registry.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/fsspec/implementations/dbfs.py b/fsspec/implementations/dbfs.py index 30c2947b0..fa71e1a22 100644 --- a/fsspec/implementations/dbfs.py +++ b/fsspec/implementations/dbfs.py @@ -412,9 +412,9 @@ def __init__( if block_size is None or block_size == "default": block_size = self.DEFAULT_BLOCK_SIZE - assert ( - block_size == self.DEFAULT_BLOCK_SIZE - ), f"Only the default block size is allowed, not {block_size}" + assert block_size == self.DEFAULT_BLOCK_SIZE, ( + f"Only the default block size is allowed, not {block_size}" + ) super().__init__( fs, diff --git a/fsspec/implementations/tests/test_tar.py b/fsspec/implementations/tests/test_tar.py index e74f54dd0..2ead3096f 100644 --- a/fsspec/implementations/tests/test_tar.py +++ b/fsspec/implementations/tests/test_tar.py @@ -97,7 +97,7 @@ def test_filesystem_direct(recipe, tmpdir): Here: `LocalFileSystem`. """ - filename = os.path.join(tmpdir, f'temp{recipe["suffix"]}') + filename = os.path.join(tmpdir, f"temp{recipe['suffix']}") fs = fsspec.filesystem("file") f = OpenFile(fs, filename, mode="wb") @@ -132,7 +132,7 @@ def test_filesystem_cached(recipe, tmpdir): Here: `TarFileSystem` over `WholeFileCacheFileSystem` over `LocalFileSystem`. """ - filename = os.path.join(tmpdir, f'temp{recipe["suffix"]}') + filename = os.path.join(tmpdir, f"temp{recipe['suffix']}") # Create a filesystem from test fixture. fs = fsspec.filesystem("file") diff --git a/fsspec/registry.py b/fsspec/registry.py index 02094ea0a..5d104f266 100644 --- a/fsspec/registry.py +++ b/fsspec/registry.py @@ -218,9 +218,9 @@ def register_implementation(name, cls, clobber=False, errtxt=None): "zip": {"class": "fsspec.implementations.zip.ZipFileSystem"}, } -assert list(known_implementations) == sorted( - known_implementations -), "Not in alphabetical order" +assert list(known_implementations) == sorted(known_implementations), ( + "Not in alphabetical order" +) def get_filesystem_class(protocol):