fix: Unpin mysqlclient and require >=2.2.0 - #198
Merged
Conversation
The <2.1 constraint was added because mysqlclient 2.1 removed the module-level MySQLdb.escape_string. DIRAC stopped using it in v8.0.81, v9.0.23 and v9.1.13, so the constraint is no longer needed. Require >=2.2.0 so that cursor.mogrify is available, and because the diracgrid channel only carries 2.0.3, which would otherwise win over conda-forge on channel priority. This also removes the need to keep rebuilding 2.0.3 for each new Python version, as conda-forge only has 2.0.3 builds up to py311. Closes DIRACGrid#190
chrisburr
enabled auto-merge (squash)
August 28, 2026 11:56
chrisburr
disabled auto-merge
August 28, 2026 12:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #190.
The
<2.1constraint was added in 4ca5a1b because mysqlclient 2.1 removed the module-levelMySQLdb.escape_string. DIRAC stopped using it in v8.0.81, v9.0.23 and v9.1.13 (all released 2026-07-06/07), so the constraint is no longer needed.Requires
>=2.2.0rather than simply dropping the upper bound because:cursor.mogrify— the feature originally requested in Updating mysqlclient? #190 — was added in 2.2.0.diracgridchannel only carries 2.0.3, which would otherwise win over conda-forge on channel priority.diracgridchannel for every new Python. conda-forge 2.2.8 already ships py314 builds for all four target platforms.Note this raises the minimum DIRAC version to v8.0.81 / v9.0.23 / v9.1.13. Older releases still call the removed module-level
escape_stringfromComponentInstaller.py; the query path inMySQL.pyused theconnection.escape_stringmethod, which still exists in 2.2.8, so the impact on an out-of-date client is limited to server-side database creation and fails loudly.BEGINRELEASENOTES
CHANGE: Require mysqlclient >=2.2.0, making cursor.mogrify available
ENDRELEASENOTES