mirror of
https://github.com/YunoHost-Apps/ihatemoney_ynh.git
synced 2024-09-03 19:26:15 +02:00
Switch from Python-MySQL → PySQL
Even if Python-MySQL is the default lib for `mysql://` scheme with SQLAlchemy, it got no release since 2014, and does not support Py3. PySQL seems to be the current standard.
This commit is contained in:
parent
05807e6a47
commit
efc35dd01d
2 changed files with 10 additions and 2 deletions
|
@ -66,7 +66,7 @@ fetch_and_extract /opt/yunohost/ihatemoney/src/ ihatemoney
|
|||
# Prepare venv
|
||||
init_virtualenv
|
||||
sudo /opt/yunohost/ihatemoney/venv/bin/pip install -r /opt/yunohost/ihatemoney/src/requirements.txt
|
||||
sudo /opt/yunohost/ihatemoney/venv/bin/pip install gunicorn>=19.3.0 MySQL-python
|
||||
sudo /opt/yunohost/ihatemoney/venv/bin/pip install 'gunicorn>=19.3.0' PyMySQL
|
||||
|
||||
# Fix permissions
|
||||
fix_permissions /opt/yunohost/ihatemoney/src
|
||||
|
|
|
@ -55,7 +55,7 @@ fix_permissions ${INSTALL_DIR}/src-new/
|
|||
|
||||
# Upgrade dependencies
|
||||
sudo ${PIP} install -r ${NEW_REQUIREMENTS}
|
||||
sudo ${PIP} install gunicorn>=19.3.0 MySQL-python
|
||||
sudo ${PIP} install 'gunicorn>=19.3.0' 'PyMySQL'
|
||||
|
||||
# Everything went ok ? Let's keep this code.
|
||||
sudo rm -rf ${INSTALL_DIR}/src
|
||||
|
@ -95,5 +95,13 @@ then
|
|||
fi
|
||||
|
||||
|
||||
|
||||
# MIGRATION: Switch Python-MySQL -> PyMySQL
|
||||
|
||||
# Python-MySQL is no longer maintained and does not support Py3
|
||||
sudo sed -i "s@'mysql://@'mysql+pymysql://@g" ${ihatemoney_conf_path}
|
||||
|
||||
|
||||
|
||||
# Restart backend
|
||||
sudo supervisorctl restart budget
|
||||
|
|
Loading…
Add table
Reference in a new issue