From 87f9b0aa48967156c113af560968dbe16c3774a5 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Thu, 18 Mar 2021 14:05:28 +0100 Subject: [PATCH] [setup] Install correct mysql driver --- readme.md | 4 +++- setup.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 1041e1e..c10cf58 100644 --- a/readme.md +++ b/readme.md @@ -17,8 +17,10 @@ You will also need a MySQL driver, recommended drivers are - `mysqlclient` - `PyMySQL` +`setup.py` will try to install a matching driver. + #### Windows -Same as above, but for mysql you have to follow this guide: +Same as above, but if you want to use `mysqlclient` instead of `PyMySQL` (performance?) you have to follow this guide: https://www.radishlogic.com/coding/python-3/installing-mysqldb-for-python-3-in-windows/ diff --git a/setup.py b/setup.py index 2986a6e..cfab611 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,7 @@ from setuptools import setup, find_packages +import os + +mysql_driver = "PyMySQL" if os.name == "nt" else "mysqlclient" setup( name="flaschengeist", @@ -19,6 +22,7 @@ setup( "flask_sqlalchemy", "flask_cors", "werkzeug", + mysql_driver ], extras_require={"ldap": ["flask_ldapconn", "ldap3"], "test": ["pytest", "coverage"]}, entry_points={