Skip to content

Commit 0a772f2

Browse files
committed
fix(ci): resolve Python 3.12 compat and cross-env mypy issues
- Use types.get_original_bases (available since 3.12) instead of version-gated import from typing that doesn't exist in 3.12 - Add type: ignore for redis from_url which lacks stubs in some envs
1 parent 2573554 commit 0a772f2

3 files changed

Lines changed: 3 additions & 13 deletions

File tree

src/pyfly/cache/auto_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def cache_adapter(self, config: Config) -> CacheAdapter:
5050
from pyfly.cache.adapters.redis import RedisCacheAdapter
5151

5252
url = str(config.get("pyfly.cache.redis.url", "redis://localhost:6379/0"))
53-
client = aioredis.from_url(url)
53+
client = aioredis.from_url(url) # type: ignore[no-untyped-call,unused-ignore]
5454
return RedisCacheAdapter(client=client)
5555

5656
from pyfly.cache.adapters.memory import InMemoryCache

src/pyfly/cqrs/command/handler.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,9 @@
2323
from __future__ import annotations
2424

2525
import logging
26-
import sys
26+
from types import get_original_bases as get_orig_bases
2727
from typing import Generic, TypeVar, get_args
2828

29-
if sys.version_info >= (3, 13):
30-
from types import get_original_bases as get_orig_bases
31-
else:
32-
from typing import get_orig_bases # type: ignore[attr-defined]
33-
3429
from pyfly.cqrs.context.execution_context import ExecutionContext
3530

3631
C = TypeVar("C") # Command type

src/pyfly/cqrs/query/handler.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,9 @@
1919
from __future__ import annotations
2020

2121
import logging
22-
import sys
22+
from types import get_original_bases as get_orig_bases
2323
from typing import Generic, TypeVar, get_args
2424

25-
if sys.version_info >= (3, 13):
26-
from types import get_original_bases as get_orig_bases
27-
else:
28-
from typing import get_orig_bases # type: ignore[attr-defined]
29-
3025
from pyfly.cqrs.context.execution_context import ExecutionContext
3126

3227
Q = TypeVar("Q") # Query type

0 commit comments

Comments
 (0)