Skip to content

Commit ee402d5

Browse files
committed
Update ci to v6 and include 3.14
1 parent 19cbb85 commit ee402d5

4 files changed

Lines changed: 18 additions & 19 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python-version: ['3.10', '3.11', '3.12', '3.13']
11+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
1212
services:
1313
postgres:
1414
image: postgres
@@ -25,9 +25,9 @@ jobs:
2525
--health-timeout 5s
2626
--health-retries 5
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v6
2929
- name: Setup python ${{ matrix.python-version}}
30-
uses: actions/setup-python@v3
30+
uses: actions/setup-python@v6
3131
with:
3232
python-version: ${{ matrix.python-version }}
3333
- name: Install dependencies
@@ -45,7 +45,7 @@ jobs:
4545
strategy:
4646
fail-fast: false
4747
matrix:
48-
python-version: ['3.10', '3.11', '3.12', '3.13']
48+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
4949
services:
5050
mariadb:
5151
image: mariadb:latest
@@ -62,9 +62,9 @@ jobs:
6262
--health-timeout=5s
6363
--health-retries=3
6464
steps:
65-
- uses: actions/checkout@v3
65+
- uses: actions/checkout@v6
6666
- name: Setup python ${{ matrix.python-version}}
67-
uses: actions/setup-python@v3
67+
uses: actions/setup-python@v6
6868
with:
6969
python-version: ${{ matrix.python-version }}
7070
- name: Install dependencies
@@ -82,17 +82,17 @@ jobs:
8282
strategy:
8383
fail-fast: false
8484
matrix:
85-
python-version: ['3.10', '3.11', '3.12', '3.13']
85+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
8686

8787
services:
8888
mongodb:
8989
image: mongo
9090
ports:
9191
- 27017:27017
9292
steps:
93-
- uses: actions/checkout@v3
93+
- uses: actions/checkout@v6
9494
- name: Setup python ${{ matrix.python-version}}
95-
uses: actions/setup-python@v3
95+
uses: actions/setup-python@v6
9696
with:
9797
python-version: ${{ matrix.python-version }}
9898
- name: Install dependencies
@@ -109,9 +109,9 @@ jobs:
109109
matrix:
110110
python-version: ['3.10', '3.11', '3.12', '3.13']
111111
steps:
112-
- uses: actions/checkout@v3
112+
- uses: actions/checkout@v6
113113
- name: Setup python ${{ matrix.python-version}}
114-
uses: actions/setup-python@v3
114+
uses: actions/setup-python@v6
115115
with:
116116
python-version: ${{ matrix.python-version }}
117117
- name: Install dependencies

atomdb/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
Created on Jun 12, 2018
99
"""
1010

11-
import asyncio
1211
import enum
1312
import logging
1413
import traceback
1514
from base64 import b64decode, b64encode
1615
from collections.abc import MutableMapping
1716
from datetime import date, datetime, time
1817
from decimal import Decimal
18+
from inspect import iscoroutinefunction
1919
from pprint import pformat
2020
from typing import Any, Callable, ClassVar
2121
from typing import Dict as DictType
@@ -310,7 +310,7 @@ async def unflatten(self, v: Any, scope: Optional[ScopeType] = None) -> Any:
310310
py_type = v.pop("__py__")
311311
coercer = self.coercers.get(py_type)
312312
if coercer:
313-
if asyncio.iscoroutinefunction(coercer):
313+
if iscoroutinefunction(coercer):
314314
return await coercer(v, scope)
315315
return coercer(v, scope)
316316
elif py_type == "set" or py_type == "atomset":
@@ -595,7 +595,7 @@ def generate_restorestate(cls: Type["Model"]) -> RestoreStateFn:
595595
expr = f"await default_unflatten(state['{f}'], scope)"
596596
else:
597597
namespace[f"unflatten_{f}"] = unflatten
598-
if asyncio.iscoroutinefunction(unflatten):
598+
if iscoroutinefunction(unflatten):
599599
expr = f"await unflatten_{f}(state['{f}'], scope)"
600600
else:
601601
expr = f"unflatten_{f}(state['{f}'], scope)"

atomdb/sql.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import logging
1616
import weakref
1717
from decimal import Decimal
18+
from inspect import iscoroutinefunction
1819
from typing import Any
1920
from typing import Callable as CallableType
2021
from typing import ClassVar
@@ -2067,7 +2068,7 @@ def generate_sql_restorestate(cls: Type["SQLModel"]) -> RestoreStateFn:
20672068
else:
20682069
# Use provided unflatten function
20692070
namespace[f"unflatten_{f}"] = unflatten
2070-
if asyncio.iscoroutinefunction(unflatten):
2071+
if iscoroutinefunction(unflatten):
20712072
expr = f"self.{f} = await unflatten_{f}(v, scope)"
20722073
else:
20732074
expr = f"self.{f} = unflatten_{f}(v, scope)"

tests/test_benchmark.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ def test_serialize_flat(benchmark):
105105
@pytest.mark.benchmark(group="base")
106106
def test_restore_flat(benchmark):
107107
def run():
108-
loop = asyncio.get_event_loop()
109-
loop.run_until_complete(Product.restore(flat_state))
108+
asyncio.run(Product.restore(flat_state))
110109

111110
benchmark(run)
112111

@@ -125,7 +124,6 @@ def test_serialize_nested(benchmark):
125124
@pytest.mark.benchmark(group="base")
126125
def test_restore_nested(benchmark):
127126
def run():
128-
loop = asyncio.get_event_loop()
129-
loop.run_until_complete(Page.restore(nested_state))
127+
asyncio.run(Page.restore(nested_state))
130128

131129
benchmark(run)

0 commit comments

Comments
 (0)