fix db url for mysqlclient

This commit is contained in:
Min RK
2023-03-22 12:42:08 +01:00
parent 9ef09a288a
commit 1430e02fa8
3 changed files with 3 additions and 3 deletions

View File

@@ -114,7 +114,7 @@ jobs:
fi
if [ "${{ matrix.db }}" == "mysql" ]; then
echo "MYSQL_HOST=127.0.0.1" >> $GITHUB_ENV
echo "JUPYTERHUB_TEST_DB_URL=mysql+mysqlclient://root@127.0.0.1:3306/jupyterhub" >> $GITHUB_ENV
echo "JUPYTERHUB_TEST_DB_URL=mysql+mysqldb://root@127.0.0.1:3306/jupyterhub" >> $GITHUB_ENV
fi
if [ "${{ matrix.ssl }}" == "ssl" ]; then
echo "SSL_ENABLED=1" >> $GITHUB_ENV

View File

@@ -179,5 +179,5 @@ For example, to connect to a mysql database with mysqlclient:
2. configure [](JupyterHub.db_url):
```python
c.JupyterHub.db_url = "mysql+mysqlclient://myuser:mypassword@my-sql-server:3306/my-db-name"
c.JupyterHub.db_url = "mysql+mysqldb://myuser:mypassword@my-sql-server:3306/my-db-name"
```

View File

@@ -35,7 +35,7 @@ def generate_old_db(env_dir, hub_version, db_url):
pkgs.append('sqlalchemy<2')
if 'mysql' in db_url:
pkgs.append('mysql-connector-python')
pkgs.append('mysqlclient')
elif 'postgres' in db_url:
pkgs.append('psycopg2-binary')
check_call([env_pip, 'install'] + pkgs)