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

Replace MySQL-python with mysqlclient. #2609

Merged
merged 5 commits into from Jan 23, 2017
Merged

Replace MySQL-python with mysqlclient. #2609

merged 5 commits into from Jan 23, 2017

Conversation

rodrigc
Copy link
Contributor

@rodrigc rodrigc commented Jan 16, 2017

MySQL-python does not work on Python 3.
On the Python Wall of Superpowers ( https://python3wos.appspot.com/ ),
mysqlclient is listed as the Python 3 alternative to MySQL-python.

@mention-bot
Copy link

@rodrigc, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tardyp, @rutsky and @tomprince to be potential reviewers.

@rodrigc rodrigc closed this Jan 17, 2017
@rodrigc rodrigc reopened this Jan 17, 2017
@tardyp
Copy link
Member

tardyp commented Jan 17, 2017

I can see in http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#py3k-support that sqlalchemy confirms it supported. So the problem should be easy. Do you need me to take a look?

@rutsky
Copy link
Member

rutsky commented Jan 17, 2017

@rodrigc docs contains info about running Buildbot test suite using MySQL database from Docker (quite easy to setup on Linux): https://docs.buildbot.net/latest/developer/database.html#run-databases-in-docker

You can use these docs for testing locally, plus please update examples there to use mysqlclient.

@tardyp tardyp closed this Jan 21, 2017
@tardyp tardyp reopened this Jan 21, 2017
MySQL-python does not work on Python 3.
On the Python Wall of Superpowers ( https://python3wos.appspot.com/ ),
mysqlclient is listed as the Python 3 alternative to MySQL-python.
@tardyp
Copy link
Member

tardyp commented Jan 23, 2017

updated the PR with some fixes for mysqlclient

try:
from _mysql_exceptions import Warning
import mysqlclient
[mysqlclient] # noqa
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try following:

import mysqlclient  # noqa pylint: disable=unused-import

instead of

import mysqlclient
[mysqlclient]  # noqa

@tardyp tardyp merged commit 760176f into buildbot:master Jan 23, 2017
@rodrigc rodrigc deleted the mysqlclient branch January 23, 2017 19:04
# we swap _mysql_exceptions.Warning arguments so that the code is in second place

def patched_init(self, *args):
if isinstance(args[0], long):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tardyp I just noticed this change that you did. This causes a problem on Python 3, because
there is no long type there. Can you fix this?

As you are introducing new patches, can you run the tests in a Python3 virtualenv, just to double check
that new Python 3 regressions are being introduced as we move forward?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants