Skip to content

Commit ba84a25

Browse files
SubCoder1fjssilva
authored andcommitted
WL#17045: Add support for Python 3.14
Change-Id: I380e5ec4bbe6b85de643f828ee751be052958faa
1 parent 9038fa4 commit ba84a25

File tree

7 files changed

+19
-9
lines changed

7 files changed

+19
-9
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ v9.5.0
1414
- WL#17049: Remove usage of SQL functions MD5() and SHA1()
1515
- WL#17088: MySQL Connector Python HeatWave GenAI and ML SDK
1616
- WL#17048: Remove Python 3.9 support
17+
- WL#17045: Add support for Python 3.14
1718

1819
v9.4.0
1920
======

mysql-connector-python/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ def main() -> None:
142142
"Programming Language :: Python :: 3.11",
143143
"Programming Language :: Python :: 3.12",
144144
"Programming Language :: Python :: 3.13",
145+
"Programming Language :: Python :: 3.14",
145146
"Topic :: Database",
146147
"Topic :: Software Development",
147148
"Topic :: Software Development :: Libraries :: Python Modules",

mysql-connector-python/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2013, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2013, 2025, Oracle and/or its affiliates.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0, as
@@ -46,7 +46,7 @@
4646
import traceback
4747
import unittest
4848

49-
from distutils.dist import Distribution
49+
from setuptools.dist import Distribution
5050
from functools import lru_cache, wraps
5151
from pkgutil import walk_packages
5252
from time import sleep

mysqlx-connector-python/lib/mysqlx/protocol.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"""Implementation of the X protocol for MySQL servers."""
3030

3131
import struct
32+
import sys
3233
import zlib
3334

3435
from io import BytesIO
@@ -42,7 +43,10 @@
4243
HAVE_LZ4 = False
4344

4445
try:
45-
import zstandard as zstd
46+
if sys.version_info.major >= 3 and sys.version_info.minor >= 14:
47+
from compression import zstd
48+
else:
49+
import zstandard as zstd
4650

4751
HAVE_ZSTD = True
4852
except ImportError:

mysqlx-connector-python/setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def main() -> None:
149149
"Programming Language :: Python :: 3.11",
150150
"Programming Language :: Python :: 3.12",
151151
"Programming Language :: Python :: 3.13",
152+
"Programming Language :: Python :: 3.14",
152153
"Topic :: Database",
153154
"Topic :: Software Development",
154155
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -160,7 +161,11 @@ def main() -> None:
160161
install_requires=["protobuf==5.29.4"],
161162
extras_require={
162163
"dns-srv": ["dnspython==2.6.1"],
163-
"compression": ["lz4==4.4.4", "zstandard==0.23.0"],
164+
"compression": (
165+
["lz4==4.4.4"] + ["zstandard==0.23.0"]
166+
if not (sys.version_info.major >= 3 and sys.version_info.minor >= 14)
167+
else []
168+
),
164169
},
165170
)
166171

@@ -180,8 +185,7 @@ def copy_metadata_files() -> None:
180185

181186

182187
def get_long_description() -> str:
183-
"""Extracts a long description from the README.rst file that is suited for this specific package.
184-
"""
188+
"""Extracts a long description from the README.rst file that is suited for this specific package."""
185189
with open(pathlib.Path(os.getcwd(), "./README.rst")) as file_handle:
186190
# The README.rst text is meant to be shared by both mysql and mysqlx packages, so after getting it we need to
187191
# parse it in order to remove the bits of text that are not meaningful for this package (mysqlx)

mysqlx-connector-python/tests/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2013, 2024, Oracle and/or its affiliates.
1+
# Copyright (c) 2013, 2025, Oracle and/or its affiliates.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0, as
@@ -45,7 +45,7 @@
4545
import traceback
4646
import unittest
4747

48-
from distutils.dist import Distribution
48+
from setuptools.dist import Distribution
4949
from functools import wraps
5050
from pkgutil import walk_packages
5151
from unittest.case import SkipTest

mysqlx-connector-python/tests/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
protobuf==5.29.4
3030
dnspython==2.6.1
3131
lz4==4.4.4
32-
zstandard>=0.12.0,<=0.19.0
32+
zstandard>=0.12.0,<=0.19.0 ; python_version < "3.14"

0 commit comments

Comments
 (0)