-
Notifications
You must be signed in to change notification settings - Fork 1k
Asyncio client support for python 3 branch #72
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
Asyncio client support for python 3 branch #72
Conversation
…synchronous tests to new standard socket library by adding more required mocks.
|
Mike, I'm looking at using this patch for one of my projects. Anything I should know before I start using the asyncio functionality? Is this tested for both serial and tcp? Any limitations with using the new 3.5 syntax (PEP 492)? |
|
Hey meeas, I am using the patch in a production environment for over a year now without issues. Note that I am using only a very limited set of pymodubus features, namely only the asynchronous client to talk to my devices over TCP. With respect to using async/await: I havent't tried this yet, but the PEP says that the 3.4 generator-based coroutines are awaitable, so you should be able to drive them via await. Let me know. |
|
I'm using this patch on production as well. Thanks @moltob ! |
dhoomakethu
left a comment
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.
@moltob I do not have a working setup for python3 . I see no harm with the PR. I will go ahead and merge,
|
@moltob I am planning to have this PR merged for pymodbus 1.4.0, any special thing in particualr to be taken care with this PR ? ( I mean known issues etc ?) |
|
Hey, nothing I know of. Various users have pulled this PR, so the asyncio functionality should be good. No defects came up so far. |
|
@moltob Thanks for the confirmation. Could you change the target branch to riptide:dev from riptideio:python3 ? |
|
Thank you @dhoomakethu for completing the merge! I'm excited to see it propagate to pip so I can go back to making my software dependent on your pip package instead of embedding @moltob 's version. |
|
@moltob , just a reminder if you haven't seen my earlier comment, could you please change the target branch for this PR from riptideio:python3 to riptideio:dev |
|
Sorry, I indeed missed your branch request. I'll do it as soon as I'm in front of a keyboard. |
|
Wow, switching the target branch looks messy! People using my PR explicitly will run into these issues now. I assume the new target branch was not created with the Python 3 fixes made by the original maintainers. Here is what I'll do: Switch the target branch back to python3 to allow using the PR as stand-alone fix. Then, please let me know what your plan is with respect to Python 3 support. The dev branch was created from master and I did not find a merge of python3 into that line so far. So either we merge my PR still to python3, and/or python3 must be merged to dev by the project maintainer first. Please let me know how you want to go ahead. |
|
ha, I now see the problem, the master is made compatible with python3 with this PR, the pip installable from the master and dev branches are compatible with both python2 and python3 . I remember approving your PR a long while ago but may be missed it because of the target branch and merged other PR for porting in to python 3 (I believe #152 ). I will go ahead and merge your branch with python3 branch and see what could be done to get this in to master. |
|
Any update on getting this into master? I'm currently using the branch ( |
|
@patrickfuller there is a PR already #187 , I am short of hands to review and make it compatible with python2 , I have no definite timeline but it will part of 1.4 for sure. |
Hi Galen,
this is the pull request, including the client code for asyncio support in Python 3 including tests and some adaptations to the existing tests. Asynchronous tests with Twisted imports have been disabled completely. Some adaptations were also made to synchronous server tests to provide mocks for standard library internal socket calls.
Also I kept the Twisted code in there to allow later merging of Python 3 and Python 2.
This pull request references a clean feature branch to ease your review.
Best,
Mike