diff --git a/.github/workflows/unit-test-latest.yml b/.github/workflows/unit-test-latest.yml index 085b085..625c9b0 100644 --- a/.github/workflows/unit-test-latest.yml +++ b/.github/workflows/unit-test-latest.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unit-test-min.yml b/.github/workflows/unit-test-min.yml index d07d7bf..a7f2e9d 100644 --- a/.github/workflows/unit-test-min.yml +++ b/.github/workflows/unit-test-min.yml @@ -3,7 +3,7 @@ name: Run unit tests with oldest dependency versions # dependencies listed in `pyproject.toml`. The oldest versions are specified in # `ci/minimum/requirements.txt`. The `requirements.txt` file is needs to # be manually updated to be aligned with `pyproject.toml`. -# +# # In the future, `pip` might be able to install the minimum versions in # `pyproject.toml` directly as disscussed in an open issue: # https://github.com/pypa/pip/issues/8085 @@ -31,7 +31,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 @@ -43,7 +43,7 @@ jobs: - name: Install packages run: | - pip install --upgrade pip + pip list pip install -e '.[tests]' pip install -r ci/minimum/requirements.txt pip list diff --git a/.github/workflows/unit-test.yml b/.github/workflows/unit-test.yml index e59e919..b80dce0 100644 --- a/.github/workflows/unit-test.yml +++ b/.github/workflows/unit-test.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 diff --git a/ci/minimum/requirements.txt b/ci/minimum/requirements.txt index f224f7d..9718251 100644 --- a/ci/minimum/requirements.txt +++ b/ci/minimum/requirements.txt @@ -5,13 +5,13 @@ nextline==0.7.13 nextline-graphql==0.7.9 alembic==1.9.0 -SQLAlchemy[asyncio]==2.0.0 +SQLAlchemy[asyncio]==2.0.31 aiosqlite==0.16.0 hypothesis==6.88.0 tomli==2.0.0 tomli-w==1.0.0 nextline-test-utils==0.1.0 -async-asgi-testclient==1.4.0 +async-asgi-testclient==1.4.10 pytest-asyncio==0.18.0 pytest-cov==3.0.0 pytest-timeout==2.1.0 diff --git a/pyproject.toml b/pyproject.toml index e452fa1..2929a84 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = [ "nextline>=0.7.13", "nextline-graphql>=0.7.9", "alembic>=1.9", - "SQLAlchemy[asyncio]>=2.0", + "SQLAlchemy[asyncio]>=2.0.31", "aiosqlite>=0.16", "hypothesis>=6.88", "tomli>=2.0", @@ -36,7 +36,7 @@ dynamic = ["version"] [project.optional-dependencies] tests = [ "nextline-test-utils>=0.1", - "async-asgi-testclient>=1.4", + "async-asgi-testclient>=1.4.10", "pytest-asyncio>=0.18", "pytest-cov>=3.0", "pytest-timeout>=2.1", diff --git a/src/nextline_rdb/alembic/models/rev_4dc6a93dfed8/tests/test_repr_val.py b/src/nextline_rdb/alembic/models/rev_4dc6a93dfed8/tests/test_repr_val.py index b552a37..54f83f7 100644 --- a/src/nextline_rdb/alembic/models/rev_4dc6a93dfed8/tests/test_repr_val.py +++ b/src/nextline_rdb/alembic/models/rev_4dc6a93dfed8/tests/test_repr_val.py @@ -1,4 +1,5 @@ import datetime +import inspect from enum import Enum from string import ascii_lowercase, ascii_uppercase @@ -67,7 +68,12 @@ def test_arbitrary_enum(data: st.DataObject) -> None: enum_type = data.draw(st_enum_type()) item = data.draw(st.sampled_from(enum_type)) repr_ = repr_val(item) - locals()[enum_type.__name__] = enum_type # so eval can find the type + + # Add as a local variable so `eval` can find it. + frame = inspect.currentframe() + assert frame + frame.f_locals[enum_type.__name__] = enum_type + eval_ = eval(repr_) assert eval_ == item diff --git a/src/nextline_rdb/alembic/models/rev_5a08750d6760/tests/test_repr_val.py b/src/nextline_rdb/alembic/models/rev_5a08750d6760/tests/test_repr_val.py index b552a37..54f83f7 100644 --- a/src/nextline_rdb/alembic/models/rev_5a08750d6760/tests/test_repr_val.py +++ b/src/nextline_rdb/alembic/models/rev_5a08750d6760/tests/test_repr_val.py @@ -1,4 +1,5 @@ import datetime +import inspect from enum import Enum from string import ascii_lowercase, ascii_uppercase @@ -67,7 +68,12 @@ def test_arbitrary_enum(data: st.DataObject) -> None: enum_type = data.draw(st_enum_type()) item = data.draw(st.sampled_from(enum_type)) repr_ = repr_val(item) - locals()[enum_type.__name__] = enum_type # so eval can find the type + + # Add as a local variable so `eval` can find it. + frame = inspect.currentframe() + assert frame + frame.f_locals[enum_type.__name__] = enum_type + eval_ = eval(repr_) assert eval_ == item diff --git a/src/nextline_rdb/alembic/models/rev_f3edea6dbde2/tests/test_repr_val.py b/src/nextline_rdb/alembic/models/rev_f3edea6dbde2/tests/test_repr_val.py index b552a37..54f83f7 100644 --- a/src/nextline_rdb/alembic/models/rev_f3edea6dbde2/tests/test_repr_val.py +++ b/src/nextline_rdb/alembic/models/rev_f3edea6dbde2/tests/test_repr_val.py @@ -1,4 +1,5 @@ import datetime +import inspect from enum import Enum from string import ascii_lowercase, ascii_uppercase @@ -67,7 +68,12 @@ def test_arbitrary_enum(data: st.DataObject) -> None: enum_type = data.draw(st_enum_type()) item = data.draw(st.sampled_from(enum_type)) repr_ = repr_val(item) - locals()[enum_type.__name__] = enum_type # so eval can find the type + + # Add as a local variable so `eval` can find it. + frame = inspect.currentframe() + assert frame + frame.f_locals[enum_type.__name__] = enum_type + eval_ = eval(repr_) assert eval_ == item diff --git a/src/nextline_rdb/alembic/models/rev_f9a742bb2297/tests/test_repr_val.py b/src/nextline_rdb/alembic/models/rev_f9a742bb2297/tests/test_repr_val.py index b552a37..54f83f7 100644 --- a/src/nextline_rdb/alembic/models/rev_f9a742bb2297/tests/test_repr_val.py +++ b/src/nextline_rdb/alembic/models/rev_f9a742bb2297/tests/test_repr_val.py @@ -1,4 +1,5 @@ import datetime +import inspect from enum import Enum from string import ascii_lowercase, ascii_uppercase @@ -67,7 +68,12 @@ def test_arbitrary_enum(data: st.DataObject) -> None: enum_type = data.draw(st_enum_type()) item = data.draw(st.sampled_from(enum_type)) repr_ = repr_val(item) - locals()[enum_type.__name__] = enum_type # so eval can find the type + + # Add as a local variable so `eval` can find it. + frame = inspect.currentframe() + assert frame + frame.f_locals[enum_type.__name__] = enum_type + eval_ = eval(repr_) assert eval_ == item diff --git a/src/nextline_rdb/models/tests/test_repr_val.py b/src/nextline_rdb/models/tests/test_repr_val.py index b552a37..54f83f7 100644 --- a/src/nextline_rdb/models/tests/test_repr_val.py +++ b/src/nextline_rdb/models/tests/test_repr_val.py @@ -1,4 +1,5 @@ import datetime +import inspect from enum import Enum from string import ascii_lowercase, ascii_uppercase @@ -67,7 +68,12 @@ def test_arbitrary_enum(data: st.DataObject) -> None: enum_type = data.draw(st_enum_type()) item = data.draw(st.sampled_from(enum_type)) repr_ = repr_val(item) - locals()[enum_type.__name__] = enum_type # so eval can find the type + + # Add as a local variable so `eval` can find it. + frame = inspect.currentframe() + assert frame + frame.f_locals[enum_type.__name__] = enum_type + eval_ = eval(repr_) assert eval_ == item