Skip to content

Commit 5f77bc9

Browse files
committed
feat: upgrade Python to 3.13, update aiohttp to 3.13.2, and add type cast to rate limiter
1 parent b49af36 commit 5f77bc9

File tree

5 files changed

+659
-561
lines changed

5 files changed

+659
-561
lines changed

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12
1+
3.13

gh_folder_download/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def collect_tasks(current_path: str, current_output: Path):
9090
# Get directory contents with rate limiting and retry
9191
def get_contents():
9292
github_client.rate_limiter.wait_if_needed()
93-
return repository.get_dir_contents(current_path, ref=sha)
93+
return repository.get_contents(current_path, ref=sha)
9494

9595
try:
9696
contents = api_retry_handler.retry_api_call(get_contents, f"get directory contents for {current_path}")
@@ -219,7 +219,7 @@ def collect_tasks(current_path: str, current_output: Path):
219219

220220
# Get directory contents without rate limiting
221221
def get_contents():
222-
return repository.get_dir_contents(current_path, ref=sha)
222+
return repository.get_contents(current_path, ref=sha)
223223

224224
try:
225225
contents = api_retry_handler.retry_api_call(get_contents, f"get directory contents for {current_path}")
@@ -344,7 +344,7 @@ def download_folder(
344344

345345
# Get directory contents with retry
346346
def get_contents():
347-
return repository.get_dir_contents(path, ref=sha)
347+
return repository.get_contents(path, ref=sha)
348348

349349
try:
350350
logger.debug(f"Getting contents for path: {path}")

gh_folder_download/rate_limiter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import threading
66
import time
77
from dataclasses import dataclass
8-
from typing import Any
8+
from typing import Any, cast
99

1010
from github import Github, GithubException
1111

@@ -76,7 +76,7 @@ def _update_rate_limit_info(self) -> None:
7676
"""Update rate limit information from GitHub API."""
7777
try:
7878
with self._lock:
79-
rate_limit = self.github.get_rate_limit()
79+
rate_limit = cast(Any, self.github.get_rate_limit())
8080

8181
# Core API rate limit
8282
core = rate_limit.core

pyproject.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ classifiers = [
1717
]
1818
keywords = ["github", "download", "folder", "cli"]
1919

20-
requires-python = ">=3.12"
20+
requires-python = ">=3.13"
2121

2222
dependencies = [
23-
"aiohttp>=3.12.6",
24-
"pydantic>=2.11.5",
25-
"pygithub>=2.6.1",
26-
"pyyaml>=6.0.2",
27-
"requests>=2.32.3",
28-
"rich>=14.0.0",
29-
"typer>=0.16.0",
23+
"aiohttp>=3.13.2",
24+
"pydantic>=2.12.5",
25+
"pygithub>=2.8.1",
26+
"pyyaml>=6.0.3",
27+
"requests>=2.32.5",
28+
"rich>=14.2.0",
29+
"typer>=0.21.0",
3030
]
3131

32+
[dependency-groups]
33+
dev = ["pytest>=9.0.2", "pytest-asyncio>=1.3.0", "ruff>=0.14.10", "ty>=0.0.7"]
34+
3235
[tool.pytest.ini_options]
3336
minversion = "6.0"
3437
addopts = "-ra -q --asyncio-mode=auto"
3538
testpaths = ["tests"]
3639

37-
[dependency-groups]
38-
dev = ["ruff>=0.11.12", "pytest>=8.0.0", "pytest-asyncio>=0.23.0", "ty>=0.0.7"]
39-
4040
[project.urls]
4141
homepage = "https://github.com/leynier/gh-folder-download"
4242
repository = "https://github.com/leynier/gh-folder-download"

0 commit comments

Comments
 (0)