Blob Blame History Raw
From 077726e8c6045b30b3d864a58436c822958e4dab Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Sun, 18 Dec 2022 11:19:34 -0500
Subject: [PATCH 1/3] Upgrade databases and SQLAlchemy

Incompatibilities with recent SQLAlchemy versions are fixed in databases
0.7.0.
---
 requirements-tests.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/requirements-tests.txt b/requirements-tests.txt
index 88a5533308d26..b14541918bb9d 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -7,8 +7,8 @@ ruff ==0.2.0
 dirty-equals ==0.6.0
 # TODO: once removing databases from tutorial, upgrade SQLAlchemy
 # probably when including SQLModel
-sqlalchemy >=1.3.18,<1.4.43
-databases[sqlite] >=0.3.2,<0.7.0
+sqlalchemy >=1.4.42,<1.5.0
+databases[sqlite] >=0.7.0,<0.9.0
 flask >=1.1.2,<3.0.0
 anyio[trio] >=3.2.1,<4.0.0
 python-jose[cryptography] >=3.3.0,<4.0.0

From dca742ea8cc1a3ea50de4912209ef3e616b60969 Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Mon, 16 Jan 2023 19:19:56 -0500
Subject: [PATCH 2/3] Ignore SQLAlchemy RemovedIn20Warning from FastAPI and
 Pydandic

We have SQLAlchemy pinned anyway; we are not yet concerned about
forward-compatibility with 2.0, especially in dependencies.
---
 pyproject.toml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pyproject.toml b/pyproject.toml
index 05c68841ffce5..d1029e3770fca 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -177,6 +177,10 @@ filterwarnings = [
     "error",
     # TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8
     'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
+    # We have SQLAlchemy pinned anyway; we are not yet concerned about
+    # forward-compatibility with 2.0, especially in dependencies.
+    'ignore::sqlalchemy.exc.RemovedIn20Warning:fastapi',
+    'ignore::sqlalchemy.exc.RemovedIn20Warning:pydantic',
     'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette',
     # TODO: remove after upgrading HTTPX to a version newer than 0.23.0
     # Including PR: https://github.com/encode/httpx/pull/2309

From 25fe108a78e707b2dfadc2acce3f5b6f44db112b Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Tue, 30 Apr 2024 09:23:58 -0400
Subject: [PATCH 3/3] Allow databases 0.9.x and SQLAlchemy 2.x for testing

---
 pyproject.toml         | 6 ++----
 requirements-tests.txt | 4 ++--
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/pyproject.toml b/pyproject.toml
index d1029e3770fca..5b9d476624d05 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -177,10 +177,8 @@ filterwarnings = [
     "error",
     # TODO: needed by asyncio in Python 3.9.7 https://bugs.python.org/issue45097, try to remove on 3.9.8
     'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
-    # We have SQLAlchemy pinned anyway; we are not yet concerned about
-    # forward-compatibility with 2.0, especially in dependencies.
-    'ignore::sqlalchemy.exc.RemovedIn20Warning:fastapi',
-    'ignore::sqlalchemy.exc.RemovedIn20Warning:pydantic',
+    # TODO: remove once Pydantic v1 is no longer supported and we can always test with SQLAlchemy 2.x
+    'ignore::sqlalchemy.exc.MovedIn20Warning',
     'ignore:starlette.middleware.wsgi is deprecated and will be removed in a future release\..*:DeprecationWarning:starlette',
     # TODO: remove after upgrading HTTPX to a version newer than 0.23.0
     # Including PR: https://github.com/encode/httpx/pull/2309
diff --git a/requirements-tests.txt b/requirements-tests.txt
index b14541918bb9d..9745e480c001b 100644
--- a/requirements-tests.txt
+++ b/requirements-tests.txt
@@ -7,8 +7,8 @@ ruff ==0.2.0
 dirty-equals ==0.6.0
 # TODO: once removing databases from tutorial, upgrade SQLAlchemy
 # probably when including SQLModel
-sqlalchemy >=1.4.42,<1.5.0
-databases[sqlite] >=0.7.0,<0.9.0
+sqlalchemy >=1.4.42,<3.0.0
+databases[sqlite] >=0.7.0,<0.10.0
 flask >=1.1.2,<3.0.0
 anyio[trio] >=3.2.1,<4.0.0
 python-jose[cryptography] >=3.3.0,<4.0.0