Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
altescy committed Dec 6, 2024
1 parent 0d763dd commit bb2b2ff
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 55 deletions.
9 changes: 3 additions & 6 deletions minato/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ def open(
cache_root: str | PathLike | None = ...,
expire_days: int | None = ...,
retry: bool = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...


@overload
Expand All @@ -65,8 +64,7 @@ def open(
cache_root: str | PathLike | None = ...,
expire_days: int | None = ...,
retry: bool = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...


@overload
Expand All @@ -87,8 +85,7 @@ def open(
cache_root: str | PathLike | None = ...,
expire_days: int | None = ...,
retry: bool = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...


def open(
Expand Down
18 changes: 6 additions & 12 deletions minato/filesystems/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...


@overload
Expand All @@ -36,8 +35,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...


@overload
Expand All @@ -50,8 +48,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...


def open_file(
Expand Down Expand Up @@ -162,8 +159,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...

@overload
def open_file(
Expand All @@ -175,8 +171,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...

@overload
def open_file(
Expand All @@ -188,8 +183,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...

def open_file(
self,
Expand Down
9 changes: 3 additions & 6 deletions minato/filesystems/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...

@overload
def open_file(
Expand All @@ -173,8 +172,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...

@overload
def open_file(
Expand All @@ -186,8 +184,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...

def open_file(
self,
Expand Down
11 changes: 4 additions & 7 deletions minato/filesystems/hf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def download(self, path: str | PathLike) -> None:

root = f"{self._url.netloc}/{self._url.path}"
if self._hf.isdir(self._url.raw):
paths = self._hf.expand_path(f"{self._url.raw}/**")
paths = self._hf.expand_path(os.path.join(self._url.raw, "**"))
else:
paths = self._hf.expand_path(self._url.raw)

Expand Down Expand Up @@ -121,8 +121,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...

@overload
def open_file(
Expand All @@ -134,8 +133,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...

@overload
def open_file(
Expand All @@ -147,8 +145,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...

def open_file(
self,
Expand Down
9 changes: 3 additions & 6 deletions minato/filesystems/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...

@overload
def open_file(
Expand All @@ -64,8 +63,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...

@overload
def open_file(
Expand All @@ -77,8 +75,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...

def open_file(
self,
Expand Down
9 changes: 3 additions & 6 deletions minato/filesystems/osfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...

@overload
def open_file(
Expand All @@ -53,8 +52,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...

@overload
def open_file(
Expand All @@ -66,8 +64,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...

def open_file(
self,
Expand Down
9 changes: 3 additions & 6 deletions minato/filesystems/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...

@overload
def open_file(
Expand All @@ -176,8 +175,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...

@overload
def open_file(
Expand All @@ -189,8 +187,7 @@ def open_file(
newline: str | None = ...,
*,
decompress: DecompressOption = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...

def open_file(
self,
Expand Down
9 changes: 3 additions & 6 deletions minato/minato.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ def open(
force_download: bool = ...,
force_extract: bool = ...,
retry: bool = ...,
) -> ContextManager[TextIO]:
...
) -> ContextManager[TextIO]: ...

@overload
def open(
Expand All @@ -75,8 +74,7 @@ def open(
force_download: bool = ...,
force_extract: bool = ...,
retry: bool = ...,
) -> ContextManager[BinaryIO]:
...
) -> ContextManager[BinaryIO]: ...

@overload
def open(
Expand All @@ -96,8 +94,7 @@ def open(
force_download: bool = ...,
force_extract: bool = ...,
retry: bool = ...,
) -> ContextManager[IO[Any]]:
...
) -> ContextManager[IO[Any]]: ...

def open(
self,
Expand Down

0 comments on commit bb2b2ff

Please sign in to comment.