stompest icon indicating copy to clipboard operation
stompest copied to clipboard

stompest.async will be unusable on python 3.7+

Open cdunklau opened this issue 7 years ago • 10 comments

This is a drive-by bug report, I don't use this lib, but I noticed that it will be impossible to use on 3.7+ since async becomes a real keyword then. Ref https://www.python.org/dev/peps/pep-0492/

cdunklau avatar Nov 22 '17 14:11 cdunklau

Thank you. That's a breaking change indeed.

Does anyone have a suggestion for an alternative to the pair of names sync/async?

nikipore avatar Dec 03 '17 18:12 nikipore

thanks @cdunklau for reporting on behalf. i ended up using the sync version instead :(

arjunv avatar Jan 19 '18 07:01 arjunv

@nikipore you intend to port the package to support python async? in that case you could follow the convention followed by similar async packages with aiostomp.

arjunv avatar Jan 19 '18 07:01 arjunv

@arjunv: I am no longer using stompest actively, because I have moved on inside the enterprise — who still uses stompest in production but has no-one with both the skill and time to maintain it — to a non-coding strategic/leadership position. Therefore, it is more of a hobby, and I have to rebuild my testing and building environment from scratch every few months which rather sucks.

A few random thoughts:

  1. I still do accept (and test) pull requests and bugfixes, but the Python 3 port was my last big effort for stompest.
  2. I believe that the (half-complete) SSL/TLS capability is the most urgent improvement because I see stompest pretty much feature complete and stable up to Python 3.6; it displays a very low rate of found bugs indeed.
  3. For Python 3.7, the stompest.async package should be renamed stompest.twisted. If someone creates a pull request, I'll test it and rename the PyPI package accordingly.
  4. A port to asyncio would make a lot of sense. If someone creates a pull request, I'll test it and create a new PyPI package.
  5. If someone wants to take over the project, please let me know. I would actively consult as an éminence grise.

nikipore avatar Jan 19 '18 18:01 nikipore

@arjunv it looks like you misunderstood this bug report. In case that's true, I'll be explicit: while it appears that stompest.async should work on versions of Python 3 that Twisted supports (3.3 - 3.6), the problem I reported is that it will just not work on 3.7+ due to the PEP 492-required change.

cdunklau avatar Jan 22 '18 19:01 cdunklau

@cdunklau Actually you cannot import the package from within an async function, as I had attempted to do, which had caused the bug in my code, in the first place. This would be true for python > 3.5 and not just 3.7+. (Of course you can globally import, but I was using a custom module to install and import external packages in runtime [for a client who can't even be bothered with installing packages], which forced me to do import within an async function).

Python 3.6.4 (default, Dec 23 2017, 19:07:07) 
>>> async def function():
...     from stompest.async import Stomp
  File "<stdin>", line 2
    from stompest.async import Stomp
                      ^
SyntaxError: invalid syntax

arjunv avatar Jan 26 '18 19:01 arjunv

Bump, has any managed to rewrite this yet? Py3.7 is installed by default now.

nitrag avatar Oct 22 '18 14:10 nitrag

Bump, it has been a while. I would hate to have to use an entirely differently library due to a naming issue like this.

zaqk avatar Aug 02 '19 16:08 zaqk

https://github.com/nikipore/stompest/pull/54#issuecomment-466560631

nikipore avatar Aug 04 '19 09:08 nikipore

I've renamed stompest.async to stompest.twisted as it was proposed, also had to update activemq user credentials for unit tests as it didn't work with the default empty user/pass.

I've checked the unit tests - all stompest.twisted tests have passed, but one test in stompest.core fails (test_5_integration_stomp_1_1_heartbeat).
https://github.com/sergey-sobolev/stompest/tree/develop

Anybody willing to test?

sergey-sobolev avatar Sep 13 '19 14:09 sergey-sobolev