-
Notifications
You must be signed in to change notification settings - Fork 160
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
Make aiopg installable in PyPy environment #361
Conversation
Please enable PyPy in travis config to make sure that library is really functional on PyPy. |
Is there a list of pypy versions available on Travis CI, or do they follow the same naming scheme as pyenv does? I test the package against |
Codecov Report
@@ Coverage Diff @@
## master #361 +/- ##
==========================================
+ Coverage 93.49% 93.55% +0.06%
==========================================
Files 23 26 +3
Lines 3550 3570 +20
Branches 205 209 +4
==========================================
+ Hits 3319 3340 +21
+ Misses 186 184 -2
- Partials 45 46 +1
Continue to review full report at Codecov.
|
Ok, currently builds fail on PyPy because of the presence of |
aiopg/utils.py
Outdated
# that imports psycopg2 will use psycopg2cffi | ||
if PY_IMPL == 'PyPy': | ||
from psycopg2cffi import compat | ||
compat.register() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have never used psycopg2cffi
, but what happened if compat.register()
called two times? or after first import of psycopg2
in other module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jettify it imports psycopg2cffi
and makes it available under psycopg2
name in sys.modules
(see https://github.com/chtd/psycopg2cffi/blob/master/psycopg2cffi/compat.py)
As long asaiopg.utils
is imported in the main package namespace before psycopg2
, all subsequent occurences of psycopg2
will be mapped to already imported psycopg2cffi
(including relative import cases that go through the main aiopg
namespace anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.
Thanks @jettify for pointing on.
Maybe better to explicitly import either psycopg2
or psycopg2cffi
?
Doing this we'll never catch an import order problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@asvetlov do you mean you would prefer psycopg2_compat
module with sth like this inside?
# aiopg/psycopg2_compat
if PY_IMPL == 'PyPy':
from psycopg2cffi import *
else:
from psycopg2 import *
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please do
@asvetlov shall I remove |
We use |
The test failures for CPython environments are now consistent with #362 due to changes introduced to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a great feature to have!
I see that this commit has been approved, are there plans to merge this anytime soon? PyPy + aiopg would be a great combination! |
|
@steven-upside so yes, I am waiting for a response from psycopg2cffi on the issue above, and on another one at chtd/psycopg2cffi#85 , after which I think I could finalise this PR. |
closing this as no longer relevant |
No description provided.