Skip to content

Commit dc59f79

Browse files
committed
chore: prepare for sqlalchemy2.0 adjustments
1 parent 2edeae9 commit dc59f79

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.github/workflows/tests.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
name: Tests
22

3-
on:
4-
push:
5-
branches:
6-
- 'master'
7-
pull_request:
8-
branches:
9-
- '*'
3+
on: [ push, pull_request ]
4+
105
jobs:
116
test:
127
runs-on: ubuntu-latest
138
strategy:
149
max-parallel: 10
1510
matrix:
16-
sql-alchemy: ["1.2", "1.3", "1.4"]
17-
python-version: ["3.7", "3.8", "3.9", "3.10"]
11+
sql-alchemy: [ "1.2", "1.3", "1.4", "2.0" ]
12+
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
1813

1914
steps:
2015
- uses: actions/checkout@v3

graphene_sqlalchemy/tests/conftest.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
from sqlalchemy import create_engine
33
from sqlalchemy.orm import sessionmaker
44

5+
# fmt: off
6+
# Fixme remove when https://github.com/kvesteri/sqlalchemy-utils/pull/644 is released #noqa
7+
import sqlalchemy # noqa # isort:skip
8+
if sqlalchemy.__version__ == "2.0.0b3": # noqa # isort:skip
9+
sqlalchemy.__version__ = "2.0.0" # noqa # isort:skip
10+
# fmt: on
11+
512
import graphene
613

714
from ..converter import convert_sqlalchemy_composite

tox.ini

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ SQLALCHEMY =
1515
1.2: sql12
1616
1.3: sql13
1717
1.4: sql14
18+
2.0: sql20
1819

1920
[testenv]
2021
passenv = GITHUB_*
@@ -23,8 +24,11 @@ deps =
2324
sql12: sqlalchemy>=1.2,<1.3
2425
sql13: sqlalchemy>=1.3,<1.4
2526
sql14: sqlalchemy>=1.4,<1.5
27+
sql20: sqlalchemy>=2.0.0b3,<2.1
28+
setenv =
29+
SQLALCHEMY_WARN_20 = 1
2630
commands =
27-
pytest graphene_sqlalchemy --cov=graphene_sqlalchemy --cov-report=term --cov-report=xml {posargs}
31+
python -W always -m pytest graphene_sqlalchemy --cov=graphene_sqlalchemy --cov-report=term --cov-report=xml {posargs}
2832

2933
[testenv:pre-commit]
3034
basepython=python3.10

0 commit comments

Comments
 (0)