Add cryptography dependency for MySQL 8 auth
pymysql needs the cryptography package to speak MySQL 8's default caching_sha2_password, so 'flask db upgrade' against a stock MySQL 8 failed with 'cryptography package is required'. Make it a real dependency (dev, prod, CI all connect cleanly) and drop the CI native-auth workaround that stood in for it.
This commit is contained in:
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
@@ -75,16 +75,13 @@ jobs:
|
|||||||
python-version: '3.13'
|
python-version: '3.13'
|
||||||
cache: pip
|
cache: pip
|
||||||
- run: pip install -r requirements.txt
|
- run: pip install -r requirements.txt
|
||||||
- name: Prime the CI database (utf8mb4 + native auth for pymysql)
|
- name: Force utf8mb4 on the CI database
|
||||||
# MySQL 8 defaults root to caching_sha2_password, which pymysql can
|
# pymysql speaks MySQL 8's caching_sha2_password via the cryptography
|
||||||
# only speak with the 'cryptography' package. Rather than add that
|
# package (a requirements.txt dependency), so no auth-plugin change
|
||||||
# dependency (and its offline wheel), switch root to native auth here
|
# is needed here.
|
||||||
# via the mysql CLI, so the app's pymysql connections work as-is.
|
|
||||||
run: |
|
run: |
|
||||||
mysql -h 127.0.0.1 -uroot -proot -e \
|
mysql -h 127.0.0.1 -uroot -proot -e \
|
||||||
"ALTER DATABASE shopdb_ci CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; \
|
"ALTER DATABASE shopdb_ci CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
|
||||||
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root'; \
|
|
||||||
FLUSH PRIVILEGES;"
|
|
||||||
- name: Fresh core upgrade from empty
|
- name: Fresh core upgrade from empty
|
||||||
run: flask db upgrade
|
run: flask db upgrade
|
||||||
- name: Install every bundled plugin (runs its chain)
|
- name: Install every bundled plugin (runs its chain)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ marshmallow-sqlalchemy>=0.29
|
|||||||
# Database
|
# Database
|
||||||
mysql-connector-python>=8.0
|
mysql-connector-python>=8.0
|
||||||
pymysql>=1.1
|
pymysql>=1.1
|
||||||
|
cryptography>=42.0 # pymysql needs it for MySQL 8 caching_sha2_password auth
|
||||||
|
|
||||||
# CLI and utilities
|
# CLI and utilities
|
||||||
click>=8.1
|
click>=8.1
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ pygments==2.20.0
|
|||||||
pyjwt==2.12.1
|
pyjwt==2.12.1
|
||||||
# via flask-jwt-extended
|
# via flask-jwt-extended
|
||||||
pymysql==1.1.3
|
pymysql==1.1.3
|
||||||
|
cryptography>=42.0
|
||||||
# via -r requirements.in
|
# via -r requirements.in
|
||||||
pytest==9.0.3
|
pytest==9.0.3
|
||||||
# via
|
# via
|
||||||
|
|||||||
Reference in New Issue
Block a user