Skip to content

Enforce ruff rule RUF022 #1720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions fsspec/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@

__all__ = [
"AbstractFileSystem",
"FSTimeoutError",
"Callback",
"FSMap",
"FSTimeoutError",
"available_compressions",
"available_protocols",
"caching",
"filesystem",
"register_implementation",
"get_filesystem_class",
"get_fs_token_paths",
"get_mapper",
"open",
"open_files",
"open_local",
"register_implementation",
"registry",
"caching",
"Callback",
"available_protocols",
"available_compressions",
"url_to_fs",
]

Expand Down
6 changes: 3 additions & 3 deletions fsspec/implementations/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ async def _get_file(
if isfilelike(lpath):
outfile = lpath
else:
outfile = open(lpath, "wb") # noqa: ASYNC101, ASYNC230
outfile = open(lpath, "wb") # noqa: ASYNC230

try:
chunk = True
Expand Down Expand Up @@ -286,7 +286,7 @@ async def gen_chunks():
context = nullcontext(lpath)
use_seek = False # might not support seeking
else:
context = open(lpath, "rb") # noqa: ASYNC101, ASYNC230
context = open(lpath, "rb") # noqa: ASYNC230
use_seek = True

with context as f:
Expand Down Expand Up @@ -812,7 +812,7 @@ async def get_range(session, url, start, end, file=None, **kwargs):
async with r:
out = await r.read()
if file:
with open(file, "r+b") as f: # noqa: ASYNC101, ASYNC230
with open(file, "r+b") as f: # noqa: ASYNC230
f.seek(start)
f.write(out)
else:
Expand Down
2 changes: 1 addition & 1 deletion fsspec/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import types
import warnings

__all__ = ["registry", "get_filesystem_class", "default"]
__all__ = ["default", "get_filesystem_class", "registry"]

# internal, mutable
_registry: dict[str, type] = {}
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ select = [
"PYI",
"RUF006",
"RUF015",
"RUF022",
"RUF024",
"SIM",
"SLOT",
Expand Down
Loading