From af50276ca68d17859e01d999e0618b86283a43ea Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sat, 7 Feb 2026 22:53:58 +0900 Subject: [PATCH 1/6] update mariadb-connector to 3.4.8 (#773) --- .github/workflows/windows.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index f8dbf87a..52dcbc1b 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -10,7 +10,7 @@ jobs: build: runs-on: windows-latest env: - CONNECTOR_VERSION: "3.4.1" + CONNECTOR_VERSION: "3.4.8" steps: - name: Cache Connector id: cache-connector @@ -23,7 +23,7 @@ jobs: if: steps.cache-connector.outputs.cache-hit != 'true' shell: bash run: | - curl -LO "https://downloads.mariadb.com/Connectors/c/connector-c-${CONNECTOR_VERSION}/mariadb-connector-c-${CONNECTOR_VERSION}-src.zip" + curl -LO "https://dlm.mariadb.com/4516912/Connectors/c/connector-c-${CONNECTOR_VERSION}/mariadb-connector-c-${CONNECTOR_VERSION}-src.zip" unzip "mariadb-connector-c-${CONNECTOR_VERSION}-src.zip" -d c:/ mv "c:/mariadb-connector-c-${CONNECTOR_VERSION}-src" c:/mariadb-connector-src @@ -82,7 +82,7 @@ jobs: CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" CIBW_ARCHS: "AMD64" CIBW_TEST_COMMAND: 'python -c "import MySQLdb; print(MySQLdb.version_info)" ' - run: "python -m cibuildwheel --prerelease-pythons --output-dir dist" + run: "python -m cibuildwheel --output-dir dist" - name: Build sdist working-directory: mysqlclient From 21b99a031c5c9776a0893927c09bb764da06f261 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Sun, 8 Feb 2026 00:10:15 +0900 Subject: [PATCH 2/6] add Python 3.14 and drop Python 3.9 (#774) --- .github/workflows/tests.yaml | 8 ++++---- .github/workflows/windows.yaml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index cf784c78..ee29bf05 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -13,9 +13,9 @@ jobs: PIP_DISABLE_PIP_VERSION_CHECK: 1 strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.12", "3.14", "3.14t"] include: - - python-version: "3.12" + - python-version: "3.11" mariadb: 1 steps: - if: ${{ matrix.mariadb }} @@ -52,7 +52,7 @@ jobs: - name: Install test dependencies run: | pip install -r requirements.txt - + - name: Run tests env: TESTDB: actions.cnf @@ -68,7 +68,7 @@ jobs: env: PIP_NO_PYTHON_VERSION_WARNING: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1 - DJANGO_VERSION: "4.2.16" + DJANGO_VERSION: "4.2.28" steps: - name: Start MySQL run: | diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index 52dcbc1b..e31eeb1d 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -79,7 +79,7 @@ jobs: - name: Build wheels working-directory: mysqlclient env: - CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" + CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10" CIBW_ARCHS: "AMD64" CIBW_TEST_COMMAND: 'python -c "import MySQLdb; print(MySQLdb.version_info)" ' run: "python -m cibuildwheel --output-dir dist" From d0371b2044588c7214579e5be5c076410baba1fc Mon Sep 17 00:00:00 2001 From: Jan Schmid Date: Sun, 8 Feb 2026 12:02:54 +0100 Subject: [PATCH 3/6] update pyproject.toml to support Python 3.14 (#772) --- pyproject.toml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d786f336..4c0c9df3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,16 +2,15 @@ name = "mysqlclient" description = "Python interface to MySQL" readme = "README.md" -requires-python = ">=3.8" +requires-python = ">=3.10" authors = [ {name = "Inada Naoki", email = "songofacandy@gmail.com"} ] -license = {text = "GNU General Public License v2 or later (GPLv2+)"} +license = "GPL-2.0-or-later" keywords = ["MySQL"] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Other Environment", - "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows :: Windows NT/2000", "Operating System :: OS Independent", @@ -21,12 +20,11 @@ classifiers = [ "Programming Language :: C", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Database", "Topic :: Database :: Database Engines/Servers", ] From aeff560b7321dd07fcc4ae71118c9e15ed51feeb Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 10 Feb 2026 12:12:18 +0900 Subject: [PATCH 4/6] free threading: do not enable GIL (#775) fix #766 --- README.md | 11 +++++++++++ src/MySQLdb/_mysql.c | 4 +++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e679b533..9bc2fd43 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,17 @@ Or when you have question about MySQL/MariaDB: * [MySQL Support](https://dev.mysql.com/support/) * [Getting Help With MariaDB](https://mariadb.com/kb/en/getting-help-with-mariadb/) +## Free threading Python + +> [!NOTE] +> The support for Free threading Python is experimental. + +Since v2.2.8, free threading is supported when importing the extension module. Therefore, importing MySQLdb does not acquire GIL. + +However, this library does not support simultaneous operations on a single Connection object from multiple threads, regardless of free threading, and the behavior in such cases remains undefined. + +> [!WARNING] +> Do not use a single Connection object from multiple threads simultaneously. ## Install diff --git a/src/MySQLdb/_mysql.c b/src/MySQLdb/_mysql.c index cd95b641..30b111e5 100644 --- a/src/MySQLdb/_mysql.c +++ b/src/MySQLdb/_mysql.c @@ -2911,7 +2911,9 @@ PyInit__mysql(void) module = PyModule_Create(&_mysqlmodule); if (!module) return module; /* this really should never happen */ - +#ifdef Py_GIL_DISABLED + PyUnstable_Module_SetGIL(module, Py_MOD_GIL_NOT_USED); +#endif if (!(dict = PyModule_GetDict(module))) goto error; if (PyDict_SetItemString(dict, "version_info", PyRun_String(QUOTE(version_info), Py_eval_input, From 33f39481493cd1cadfd2a63252382b7d839591b2 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 10 Feb 2026 17:27:43 +0900 Subject: [PATCH 5/6] release v2.2.8 (#776) --- HISTORY.rst | 14 ++++++++++++++ src/MySQLdb/release.py | 4 ++-- tests/travis.cnf | 10 ---------- 3 files changed, 16 insertions(+), 12 deletions(-) delete mode 100644 tests/travis.cnf diff --git a/HISTORY.rst b/HISTORY.rst index 66470541..63bf11bb 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,3 +1,17 @@ +====================== + What's new in 2.2.8 +====================== + +Release: 2026-02-10 + +* Add ``local_infile_dir`` option to restrict LOAD DATA LOCAL INFILE file path. (#755) +* windows wheel: Update mariadb-connector to 3.4.8 (#773) +* Add Python 3.14 and drop Python 3.8, 3.9 support. (#774) +* Experimental support for free threaded Python. Importing ``MySQLdb`` doesn't + enable the GIL anymore. This doesn't mean mysqlclient is thread safe. + You must not use same connection object from multiple threads concurrently. (#775) + + ====================== What's new in 2.2.7 ====================== diff --git a/src/MySQLdb/release.py b/src/MySQLdb/release.py index 234d9958..88ddab2c 100644 --- a/src/MySQLdb/release.py +++ b/src/MySQLdb/release.py @@ -1,3 +1,3 @@ __author__ = "Inada Naoki " -__version__ = "2.2.7" -version_info = (2, 2, 7, "final", 0) +__version__ = "2.2.8" +version_info = (2, 2, 8, "final", 0) diff --git a/tests/travis.cnf b/tests/travis.cnf deleted file mode 100644 index 5fd6f847..00000000 --- a/tests/travis.cnf +++ /dev/null @@ -1,10 +0,0 @@ -# To create your own custom version of this file, read -# http://dev.mysql.com/doc/refman/5.1/en/option-files.html -# and set TESTDB in your environment to the name of the file - -[MySQLdb-tests] -host = 127.0.0.1 -port = 3306 -user = root -database = mysqldb_test -default-character-set = utf8mb4 From a417303a0597113d2299f63c04f9055e09950ee1 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Thu, 12 Feb 2026 15:06:31 +0900 Subject: [PATCH 6/6] require setuptools>=77 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4c0c9df3..9deedef3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ Project = "https://github.com/PyMySQL/mysqlclient" Documentation = "https://mysqlclient.readthedocs.io/" [build-system] -requires = ["setuptools>=61"] +requires = ["setuptools>=77"] build-backend = "setuptools.build_meta" [tool.setuptools]