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

Compatibility with PyMySQL == 0.9.0 #302

Closed
LilyMaster opened this issue Jun 27, 2018 · 11 comments · Fixed by #312
Closed

Compatibility with PyMySQL == 0.9.0 #302

LilyMaster opened this issue Jun 27, 2018 · 11 comments · Fixed by #312

Comments

@LilyMaster
Copy link

PyMySQL has been updated to 0.9.0 and has some incompatible changes. Namely, I get error:

lib/python3.6/site-packages/aiomysql/__init__.py:32: in <module>
    from .connection import Connection, connect
lib/python3.6/site-packages/aiomysql/connection.py:30: in <module>
    from pymysql.connections import _scramble
ImportError: cannot import name '_scramble'
@marcoceppi
Copy link
Contributor

For those experiencing this, on a lovely Wednesday, pin PyMySQL to 0.8.1 in your setup / requirements.txt

PyMySQL==0.8.1

@arnulfojr
Copy link

arnulfojr commented Jun 27, 2018

And this one is related to #297, if I'm not mistaken :)
(Hope I'm saving time to someone)

@marcoceppi
Copy link
Contributor

Pretty likely, the biggest issue is the way dependencies are described in this repository. They should really be pinned like

PyMySQL>=0.7.5,<0.9

The second comparison should be increased when the library is tested with each successive version of of PyMySQL. This will prevent things like a new library adding a breaking change from catching users off guard. I'll submit a PR to do just that and hopefully a patch can be cut until a more permanent patch to make this library work with PyMySQL 0.9.0

@arnulfojr
Copy link

Yea, the thing is that the release just went live some hours ago, check it out https://github.com/PyMySQL/PyMySQL/releases unfortunately we are one of the firsts to get the issue.
Quick fix should be the version limitation, proper fix should be to update the code.
Let's wait and see what the members say about it, I guess

@thesamet
Copy link

thesamet commented Jun 27, 2018

Workaround: add PyMySQL==0.7.5 to your project requirements.

@arnulfojr
Copy link

@thesamet the issue is with the latest 0.9.0 so you are safe of using the 0.8.1 as well :)

@marcoceppi
Copy link
Contributor

@arnulfojr To be fair, this project is getting hit with this because PyMySQL was open ended >= whereas the rest of the dependencies (esp in requirements-dev) are ==. While not a absolute, a best practice is to do explicit pinning using either == or an upper limit. My workaround is minor, but it'll stop peoples builds from failing.

I absolutely agree aiomysql should work with 0.9 and MySQL 8 but that's likely a larger patch set.

@arnulfojr
Copy link

@marcoceppi totally agree :)

@and800
Copy link

and800 commented Jun 27, 2018

I absolutely agree aiomysql should work with 0.9 and MySQL 8 but that's likely a larger patch set.

I don't think it is so hard. We should stop using pymysql's private api. Instead, we can for example copypaste its private objects into vendor dir, so they won't be changed by minor updates

@terricain
Copy link
Collaborator

Am planning to look at fixing the imports tonight, they've just moved them to the _auth module. Will also look into adding sha256 password support

@terricain
Copy link
Collaborator

Have MySQL 8 / sha256 support here https://github.com/terrycain/aiomysql/tree/sha256, will pr it after #309. Just thought I'd drop it incase its useful

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 a pull request may close this issue.

6 participants