Skip to content

Commit

Permalink
Merge pull request #67 from altescy/python-313
Browse files Browse the repository at this point in the history
Support Python 3.12/3.13
  • Loading branch information
altescy authored Dec 6, 2024
2 parents 3a7a119 + 3dcc754 commit 62ed150
Show file tree
Hide file tree
Showing 14 changed files with 1,553 additions and 1,066 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

strategy:
matrix:
Expand All @@ -17,24 +17,26 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --extras all
make clean
run: poetry install --extras all

- name: Lint with pysen
run: |
make lint
run: make lint

- name: Test with pytest
run: |
make test
run: make test
6 changes: 3 additions & 3 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ on:

jobs:
deploy:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Build and publish to pypi
uses: JRubics/poetry-publish@v1.8
uses: JRubics/poetry-publish@v2.0
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
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
Loading

0 comments on commit 62ed150

Please sign in to comment.