summaryrefslogtreecommitdiff
path: root/django/db
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2025-01-28 08:02:13 +0100
committerGitHub <noreply@github.com>2025-01-28 08:02:13 +0100
commitd9af197801376fae178761cac12d57178a738cf4 (patch)
tree90f7ced27f7d847da4e29337e131696492047a4d /django/db
parent8eca4077f60fa0705ecfd9437c9ceaeef7a3808b (diff)
Refs #36005 -- Bumped minimum supported versions of 3rd-party packages.
This bumps minimum supported versions of 3rd-party packages to the first releases to support Python 3.12.
Diffstat (limited to 'django/db')
-rw-r--r--django/db/backends/mysql/base.py10
-rw-r--r--django/db/backends/postgresql/base.py10
2 files changed, 7 insertions, 13 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py
index eb0e361d8d..e594067b50 100644
--- a/django/db/backends/mysql/base.py
+++ b/django/db/backends/mysql/base.py
@@ -32,9 +32,9 @@ from .schema import DatabaseSchemaEditor
from .validation import DatabaseValidation
version = Database.version_info
-if version < (1, 4, 3):
+if version < (2, 2, 1):
raise ImproperlyConfigured(
- "mysqlclient 1.4.3 or newer is required; you have %s." % Database.__version__
+ "mysqlclient 2.2.1 or newer is required; you have %s." % Database.__version__
)
@@ -254,12 +254,6 @@ class DatabaseWrapper(BaseDatabaseWrapper):
@async_unsafe
def get_new_connection(self, conn_params):
connection = Database.connect(**conn_params)
- # bytes encoder in mysqlclient doesn't work and was added only to
- # prevent KeyErrors in Django < 2.0. We can remove this workaround when
- # mysqlclient 2.1 becomes the minimal mysqlclient supported by Django.
- # See https://github.com/PyMySQL/mysqlclient/issues/489
- if connection.encoders.get(bytes) is bytes:
- connection.encoders.pop(bytes)
return connection
def init_connection_state(self):
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index c864cab57a..a0b5e4154e 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -1,7 +1,7 @@
"""
PostgreSQL database backend for Django.
-Requires psycopg2 >= 2.8.4 or psycopg >= 3.1.8
+Requires psycopg2 >= 2.9.9 or psycopg >= 3.1.12
"""
import asyncio
@@ -34,13 +34,13 @@ def psycopg_version():
return get_version_tuple(version)
-if psycopg_version() < (2, 8, 4):
+if psycopg_version() < (2, 9, 9):
raise ImproperlyConfigured(
- f"psycopg2 version 2.8.4 or newer is required; you have {Database.__version__}"
+ f"psycopg2 version 2.9.9 or newer is required; you have {Database.__version__}"
)
-if (3,) <= psycopg_version() < (3, 1, 8):
+if (3,) <= psycopg_version() < (3, 1, 12):
raise ImproperlyConfigured(
- f"psycopg version 3.1.8 or newer is required; you have {Database.__version__}"
+ f"psycopg version 3.1.12 or newer is required; you have {Database.__version__}"
)