Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Python 3.11 and MySQL 5.7 #1148

Closed
wants to merge 278 commits into from

Conversation

ethho
Copy link
Contributor

@ethho ethho commented Jan 3, 2024

The purpose of this PR is to add support for Python 3.10 and 3.11 with MySQL 5.7, fixing #1149 . My question to @dimitri-yatsenko is: do we even want to support this use case?

JIRA ticket: https://datajoint.atlassian.net/browse/PLAT-188

As discovered in #1146 (comment), calls to dj.conn and dj.Connection sometimes fail when called with default arguments, using Python 3.11 and MySQL 5.7. All tests pass with Python <=3.8 and MySQL 5.7 or 8.0, and all tests pass with Python 3.11 and MySQL 8.0, as corroborated by CI in #1146.

Additional Details

I believe that these failures relate to the default TLS/SSL configuration in MySQL 5.7 and 8.0, and some assumptions that we make about this default configuration when setting the default values (particularly the use_tls kwarg) in datajoint.conn and datajoint.Connection.__init__. This might be due to an incompatibility between MySQL 5.7 and PyMySQL v1.0.2, though I'll note that pymysql==1.0.2 used in the pytest containers I tried for both Python 3.8 and Python 3.11:

Console logs
$ PY_VER=3.8 MYSQL_VER=8.0 DISTRO=alpine MINIO_VER=RELEASE.2022-08-11T04-37-28Z HOST_UID=$(id -u) dkc run -it app sh
[+] Creating 3/3
 ✔ Container ethho-datajoint-python-db-1                         Recreated                                                        10.6s 
 ✔ Container ethho-datajoint-python-fakeservices.datajoint.io-1  Running                                                           0.0s 
 ✔ Container ethho-datajoint-python-minio-1                      Running                                                           0.0s 
[+] Running 1/1
 ✔ Container ethho-datajoint-python-db-1  Started                                                                                  0.3s 
(base) anaconda@fc9662eee1b8:/src$ python3 --version
Python 3.8.15
(base) anaconda@fc9662eee1b8:/src$ pip show pymysql
Name: PyMySQL
Version: 1.0.2
Summary: Pure Python MySQL Driver
Home-page: https://github.com/PyMySQL/PyMySQL/
Author: yutaka.matsubara
Author-email: yutaka.matsubara@gmail.com
License: "MIT"
Location: /opt/conda/lib/python3.8/site-packages
Requires: 
Required-by: 

$ PY_VER=3.11 MYSQL_VER=8.0 DISTRO=alpine MINIO_VER=RELEASE.2022-08-11T04-37-28Z HOST_UID=$(id -u) dkc run -it app sh
[+] Creating 3/0
 ✔ Container ethho-datajoint-python-fakeservices.datajoint.io-1  Running                                                           0.0s 
 ✔ Container ethho-datajoint-python-db-1                         Running                                                           0.0s 
 ✔ Container ethho-datajoint-python-minio-1                      Running                                                           0.0s 
(base) anaconda@88726ce26db5:/src$ python3 --version
Python 3.11.0
(base) anaconda@88726ce26db5:/src$ pip show pymysql
Name: PyMySQL
Version: 1.0.2
Summary: Pure Python MySQL Driver
Home-page: https://github.com/PyMySQL/PyMySQL/
Author: yutaka.matsubara
Author-email: yutaka.matsubara@gmail.com
License: "MIT"
Location: /opt/conda/lib/python3.11/site-packages
Requires: 
Required-by: 

Commits

  • All changes in Migrate nose tests to pytest #1142
  • Use TLS config for Connection constructor
  • Use fixture for test_json skip
  • For use_tls, use config value if not provided as kwarg

ethho and others added 30 commits December 4, 2023 13:16
MySQL 8.0 in Docker was ignoring the MYSQL_ROOT_PASSWORD
environment variable, setting the default user/pass to root
and password. Update the env vars in the dev stack to match
these values.
ethho and others added 24 commits December 15, 2023 14:21
Clean up modules that were migrated in
PRs: datajoint#1136, 1137, 1138, 1139, 1140
No reason for this to be defined in the fixture.
Move to the module level to stay consistent.
Ensures that dj.blob.use_32bit_dims is turned off
even if test_insert_longblob fails.
@ethho
Copy link
Contributor Author

ethho commented Feb 26, 2024

@dimitri-yatsenko , @corprew , and @ethho agreed that for OS projects, we will not support versions of dependencies that are no longer receiving security updates. This includes MySQL 5.7, so we will deprecate this version in datajoint-python and close this ticket.

@ethho ethho closed this Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants