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

Make aiomqtt compatible with paho v2 #279

Closed
JonathanPlasse opened this issue Feb 22, 2024 · 10 comments · Fixed by #286
Closed

Make aiomqtt compatible with paho v2 #279

JonathanPlasse opened this issue Feb 22, 2024 · 10 comments · Fixed by #286
Assignees

Comments

@JonathanPlasse
Copy link
Collaborator

We could use paho.mqtt.__version__ to determine at runtime whether to pass mqtt.CallbackAPIVersion.VERSION1 to the init call to the paho client.

if mqtt.__version__.startswith("2"):
    client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1)
else:
   client = mqtt.Client()
@skewty
Copy link
Contributor

skewty commented Mar 18, 2024

Is there a compelling reason to not couple "^2.0" and work with it as it is by default?

I did a quick look at the paho v2 asyncio examples and it doesn't look like much has changed / changes look minimal.

@JonathanPlasse
Copy link
Collaborator Author

I will do the PR tonight.

@JonathanPlasse JonathanPlasse self-assigned this Mar 18, 2024
@JonathanPlasse
Copy link
Collaborator Author

This is not as trivial as I thought, the typing and mypy are getting in the way.

@JonathanPlasse
Copy link
Collaborator Author

Hey @empicano, @frederikaalund,

Managing typings for both paho-mqtt 1.6.1 and the newer 2.0 version adds many complexities. Given that 1.6.1 is significantly outdated now, I'm leaning towards fully embracing version 2.0 and discontinuing support for the older one.

This will allow us to leverage the latest features and improvements in 2.0. What are your thoughts on making this transition?

@empicano
Copy link
Owner

Sounds sensible to me 👍 The extra maintenance burden doesn't seem worth it 🙂

@frederikaalund
Copy link
Collaborator

I agree, it sounds very sensible to drop support for the v1.x line of paho.mqtt.

@skewty
Copy link
Contributor

skewty commented Mar 23, 2024

Did this work move into another fork / repo or did development stall? I am not seeing any changes in 5 days.

1862ead

@empicano
Copy link
Owner

We do this in our free time and for fun, sometimes things take a a little while, and that's okay. If you want to speed things up, you can offer to help out, maybe Jonathan will take you up for it 🙂

@skewty
Copy link
Contributor

skewty commented Apr 1, 2024

Will this go out to pypi as v2.1?

Currently testing it out (no issues so far):

[tool.poetry.dependencies]
aiomqtt = { git = "https://github.com/sbtinstruments/aiomqtt.git", rev = "8321217" }  # until > v2.0.1 released

@skewty
Copy link
Contributor

skewty commented Apr 17, 2024

Is some issue holding up a new pypi release? If so, perhaps this issue should be re-opened with a link to that issue.

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.

4 participants