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

Fix legacy __aiter__ methods #403

Merged
merged 2 commits into from May 22, 2019

Conversation

Askaholic
Copy link
Contributor

@Askaholic Askaholic commented May 10, 2019

This allows the async for syntax to be used with ResultProxy and Cursor objects in python 3.7.

Fixes #394
Fixes #386
Fixes #317

@codecov
Copy link

codecov bot commented May 10, 2019

Codecov Report

Merging #403 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #403   +/-   ##
=======================================
  Coverage   92.28%   92.28%           
=======================================
  Files           9        9           
  Lines        1180     1180           
  Branches      172      172           
=======================================
  Hits         1089     1089           
  Misses         64       64           
  Partials       27       27
Impacted Files Coverage Δ
aiomysql/sa/result.py 92% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 131fb9f...76b4349. Read the comment docs.

@terrycain
Copy link
Collaborator

@thehesiod thoughts on this, looks fine to me.

@thehesiod
Copy link

@terrycain aiohttp moved to 3.5.3+ to avoid this, should this lib as well?

@terrycain
Copy link
Collaborator

Yeah I see no issue moving it to 3.5.3+ @jettify any objections?

@Askaholic
Copy link
Contributor Author

Supporting only 3.5.3+ would make the fix even easier. Just let me know

@asvetlov
Copy link
Member

Pretty sure @jettify has no objections :)

Side note: after sadly delaying aiohttp new release (totally my fault, my spare time is very limited now) I started to cut-off Python 3.5 in aiohttp 4.0 entirely.
I'm still extremely busy by working on asyncio for Python 3.8.
So aiohttp 4.0 has a chance to be released in August or September. The major release is a chance to change API significantly, a lot to do.
Perhaps aiomysql should sit on 3.5.3 though: new version can be published quickly.

For me the main indicator is Debian 10.

@Askaholic Askaholic force-pushed the issue/#394-fix-legacy-aiter branch from 6504643 to 63c1b1e Compare May 18, 2019 19:16
@Askaholic
Copy link
Contributor Author

Why does SAConnectionContextManager have an __aiter__ method? Does this need to be changed to a regular function as well?

class _SAConnectionContextManager(_ContextManager):

@Askaholic Askaholic changed the title Add backwards compatible fix for legacy __aiter__ methods Fix legacy __aiter__ methods May 18, 2019
@terrycain
Copy link
Collaborator

Supporting 3.5.3+ i think would make sense for now, not sure on our 3.5 userbase but < 3.5.3 was fraught with issues.

@Askaholic you mind updating the setup.py to mandate 3.5.3+ ?

@Askaholic
Copy link
Contributor Author

@terrycain The setup.py already does this: https://github.com/aio-libs/aiomysql/blob/master/setup.py#L13

raise RuntimeError("aiomysql doesn't support Python earlier than 3.5.3")

@terrycain terrycain merged commit 8ef840f into aio-libs:master May 22, 2019
@jaggerwang
Copy link

@terrycain It has been three months passed, when this fix will publish to pip?

@Askaholic
Copy link
Contributor Author

@jaggerwang If you are really desperate, you can try installing directly from git: https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch

@jaggerwang
Copy link

@Askaholic Thanks! But this way is not so good, I choose waiting... The last update of the pip package is still at 2018:(

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