Skip to content

Commit 66a88dc

Browse files
mhaururbuffat
andauthored
Add support for SQLAlchemy 2.0, continued (#275)
* Add support for SQLAlchemy 2 * Support SQLAlchemy 2 dataclasses * Expand the test matrix Co-authored-by: René Buffat <[email protected]>
1 parent 6ecfbc4 commit 66a88dc

15 files changed

+5955
-2935
lines changed

.github/workflows/test.yml

+9-3
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,24 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
python-version: ["3.7", "3.9", "3.11"]
13+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
14+
sqlalchemy-version: ["1.4", "2.0"]
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v3
1718
- name: Set up Python ${{ matrix.python-version }}
1819
uses: actions/setup-python@v4
1920
with:
2021
python-version: ${{ matrix.python-version }}
22+
allow-prereleases: true
2123
cache: pip
2224
cache-dependency-path: pyproject.toml
23-
- name: Install dependencies
24-
run: pip install -e .[test] coveralls
25+
- name: Install dependencies SQLAlchemy 1.4
26+
if: matrix.sqlalchemy-version == 1.4
27+
run: pip install -e .[test,sqlmodel] coveralls SQLAlchemy==1.4.*
28+
- name: Install dependencies SQLAlchemy 2.0
29+
if: matrix.sqlalchemy-version == 2.0
30+
run: pip install -e .[test] coveralls SQLAlchemy==2.0.*
2531
- name: Test with pytest
2632
run: coverage run -m pytest
2733
- name: Upload Coverage

CHANGES.rst

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Version history
22
===============
33

4+
**3.0.0rc3**
5+
6+
- Added support for SQLAlchemy 2 (PR by rbuffat with help from mhauru)
7+
48
**3.0.0rc2**
59

610
- Added support for generating SQLModel classes (PR by Andrii Khirilov)

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ latest SQLAlchemy version).
1818
Features
1919
========
2020

21-
* Supports SQLAlchemy 1.4.x
21+
* Supports SQLAlchemy 1.4.x and 2
2222
* Produces declarative code that almost looks like it was hand written
2323
* Produces `PEP 8`_ compliant code
2424
* Accurately determines relationships, including many-to-many, one-to-one

pyproject.toml

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ classifiers = [
2525
"Programming Language :: Python :: 3.8",
2626
"Programming Language :: Python :: 3.9",
2727
"Programming Language :: Python :: 3.10",
28+
"Programming Language :: Python :: 3.11",
2829
]
2930
requires-python = ">=3.7"
3031
dependencies = [
31-
"SQLAlchemy >= 1.4.36, < 2.0",
32+
"SQLAlchemy >= 1.4.36",
3233
"inflect >= 4.0.0",
3334
"importlib_metadata; python_version < '3.10'",
35+
"greenlet >= 3.0.0a1; python_version >= '3.12'",
3436
]
3537
dynamic = ["version"]
3638

@@ -44,6 +46,8 @@ test = [
4446
"pytest-cov",
4547
"psycopg2-binary",
4648
"mysql-connector-python",
49+
]
50+
sqlmodel = [
4751
"sqlmodel",
4852
]
4953
citext = ["sqlalchemy-citext >= 1.7.0"]
@@ -88,7 +92,7 @@ show_missing = true
8892
[tool.tox]
8993
legacy_tox_ini = """
9094
[tox]
91-
envlist = py37, py38, py39, py310
95+
envlist = py37, py38, py39, py310, py311, py312
9296
skip_missing_interpreters = true
9397
isolated_build = true
9498

0 commit comments

Comments
 (0)