diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 8fc096557065d3adbeea9569c3ac1db69952acd5..d0fa4f865b0295cd93ccfc200005f586079c15c5 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -40,7 +40,7 @@ jobs: include: # oldest python/sqlalchemy supported - python-version: "3.8" - sqlalchemy-version: "1.4" + sqlalchemy-version: "1.4.18" services: eralchemy-db: image: postgres:alpine diff --git a/example/forum.py b/example/forum.py index a273ff7d20ee70c9f946fc3c021faf0b16b66fd1..4d84391eadb6d6b266493383434b27365f38f6cb 100644 --- a/example/forum.py +++ b/example/forum.py @@ -17,11 +17,9 @@ from sqlalchemy import ( Unicode, UnicodeText, ) -from sqlalchemy.orm import DeclarativeBase, Relationship +from sqlalchemy.orm import Relationship, declarative_base - -class Base(DeclarativeBase): - pass +Base = declarative_base() post_tags = Table( diff --git a/example/graph.py b/example/graph.py index b6a2d483c80575de6f7c200ce82159732b210d95..aaf083d39c47e10769d26b0372e21959409ab978 100644 --- a/example/graph.py +++ b/example/graph.py @@ -4,13 +4,11 @@ from __future__ import annotations from sqlalchemy import ForeignKey, Integer -from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column, relationship +from sqlalchemy.orm import Mapped, declarative_base, mapped_column, relationship from eralchemy import render_er - -class Base(DeclarativeBase): - pass +Base = declarative_base() class Node(Base): diff --git a/pyproject.toml b/pyproject.toml index bdad3cc97bb160fec245b282c1a842aaae83faa3..3aa824ad78812bba2ab87584a49908b11ab3e311 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ classifiers=[ ] requires-python = ">=3.8" dependencies = [ - "sqlalchemy >= 1.4" + "sqlalchemy >= 1.4.18" ] [project.urls] diff --git a/tests/test_sqla_multi_key.py b/tests/test_sqla_multi_key.py index 295a1182482eba5f29aefeef6f8e03113b00f5a8..cc31ed9c75697dacba05af297500d01baef9c5c1 100644 --- a/tests/test_sqla_multi_key.py +++ b/tests/test_sqla_multi_key.py @@ -1,5 +1,5 @@ from sqlalchemy import Column, ForeignKey, String -from sqlalchemy.orm import DeclarativeBase +from sqlalchemy.orm import declarative_base from eralchemy.models import Relation, Table from eralchemy.sqla import ( @@ -8,8 +8,7 @@ from eralchemy.sqla import ( def test_columns_parent(): - class Base(DeclarativeBase): - pass + Base = declarative_base() class Parent(Base): __tablename__ = "parent" @@ -32,8 +31,7 @@ def test_columns_parent(): def test_columns_one_to_many_parent(): - class Base(DeclarativeBase): - pass + Base = declarative_base() class Parent(Base): __tablename__ = "parent" @@ -56,8 +54,7 @@ def test_columns_one_to_many_parent(): def test_columns_one_to_one_parent(): - class Base(DeclarativeBase): - pass + Base = declarative_base() class Parent(Base): __tablename__ = "parent" @@ -79,8 +76,7 @@ def test_columns_one_to_one_parent(): def test_compound_one_to_one_parent(): - class Base(DeclarativeBase): - pass + Base = declarative_base() class Parent(Base): __tablename__ = "parent"