Skip to content

fix: Unpin mysqlclient and require >=2.2.0 - #198

Merged
chrisburr merged 1 commit into
DIRACGrid:mainfrom
chrisburr:chore/unpin-mysqlclient
Aug 28, 2026
Merged

fix: Unpin mysqlclient and require >=2.2.0#198
chrisburr merged 1 commit into
DIRACGrid:mainfrom
chrisburr:chore/unpin-mysqlclient

Conversation

@chrisburr

Copy link
Copy Markdown
Member

Fixes #190.

The <2.1 constraint was added in 4ca5a1b 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 (all released 2026-07-06/07), so the constraint is no longer needed.

Requires >=2.2.0 rather than simply dropping the upper bound because:

  • cursor.mogrify — the feature originally requested in Updating mysqlclient? #190 — was added in 2.2.0.
  • The diracgrid channel only carries 2.0.3, which would otherwise win over conda-forge on channel priority.
  • conda-forge only has 2.0.3 builds up to py311, so keeping the pin means rebuilding 2.0.3 in the diracgrid channel 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_string from ComponentInstaller.py; the query path in MySQL.py used the connection.escape_string method, 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

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
chrisburr enabled auto-merge (squash) August 28, 2026 11:56
@chrisburr
chrisburr disabled auto-merge August 28, 2026 12:17
@chrisburr
chrisburr merged commit 97c42a4 into DIRACGrid:main Aug 28, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Updating mysqlclient?

1 participant