Skip to content

Commit

Permalink
Merge pull request #142 from simonsobs/dev
Browse files Browse the repository at this point in the history
Add tests on Python 3.13 in GitHub Actions
  • Loading branch information
TaiSakuma authored Oct 18, 2024
2 parents 03cea7f + 04d8fd5 commit e05d071
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test-min.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ci/minimum/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import inspect
from enum import Enum
from string import ascii_lowercase, ascii_uppercase

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import inspect
from enum import Enum
from string import ascii_lowercase, ascii_uppercase

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import inspect
from enum import Enum
from string import ascii_lowercase, ascii_uppercase

Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import inspect
from enum import Enum
from string import ascii_lowercase, ascii_uppercase

Expand Down Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion src/nextline_rdb/models/tests/test_repr_val.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import datetime
import inspect
from enum import Enum
from string import ascii_lowercase, ascii_uppercase

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e05d071

Please sign in to comment.