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

Doesn't work with aiomqtt 2.0.0 #13

Open
normanr opened this issue Jan 21, 2024 · 3 comments
Open

Doesn't work with aiomqtt 2.0.0 #13

normanr opened this issue Jan 21, 2024 · 3 comments
Labels
good first issue Good for newcomers

Comments

@normanr
Copy link
Contributor

normanr commented Jan 21, 2024

Quick fix is to update requirement.txt to have aiomqtt==1.2.1

Longer fix is to follow https://sbtinstruments.github.io/aiomqtt/migration-guide-v2.html

flavio-fernandes added a commit that referenced this issue Jan 21, 2024
Issue: #13
Incompatible with aiomqtt 2.0.0

This is a temporary fix, pending the implementation
of modifications mentioned in:
https://sbtinstruments.github.io/aiomqtt/migration-guide-v2.html

Co-authored-by: Norman Rasmussen <[email protected]>
Signed-off-by: Flavio Fernandes <[email protected]>
@flavio-fernandes flavio-fernandes added the good first issue Good for newcomers label Jan 21, 2024
@flavio-fernandes
Copy link
Owner

flavio-fernandes commented Jan 21, 2024

Thank you @normanr ! I merged in the temporary fix.
Interestingly, I noticed that pip install on a python 3.7 is not picking up aiomqtt 2.0.0, which is probably why I never saw this issue.

For convenience, I started a vm using Vagrant: vagrant up

$ vagrant ssh
(env) vagrant@mqtt2kasaVM:~$ pip list
Package            Version
------------------ -------
aiomqtt            1.1.0
anyio              3.7.1
asyncclick         8.1.7.1
asyncio-throttle   1.0.2
exceptiongroup     1.2.0
idna               3.6
importlib-metadata 6.7.0
paho-mqtt          1.6.1
pip                23.3.2
pydantic           1.10.14
python-kasa        0.5.1
PyYAML             6.0.1
setuptools         47.1.0
sniffio            1.3.0
typing_extensions  4.7.1
zipp               3.15.0
(env) vagrant@mqtt2kasaVM:~$ python --version
Python 3.7.17
(env) vagrant@mqtt2kasaVM:~$ pip install aiomqtt==1.2.1
ERROR: Ignored the following yanked versions: 0.17.0
ERROR: Ignored the following versions that require a different python version: 1.2.0 Requires-Python >=3.8,<4.0; 1.2.1 Requires-Python >=3.8,<4.0; 2.0.0 Requires-Python >=3.8,<4.0
ERROR: Could not find a version that satisfies the requirement aiomqtt==1.2.1 (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 1.0.0, 1.1.0)
ERROR: No matching distribution found for aiomqtt==1.2.1
(env) vagrant@mqtt2kasaVM:~$ pip install aiomqtt==2.0.0
ERROR: Ignored the following yanked versions: 0.17.0
ERROR: Ignored the following versions that require a different python version: 1.2.0 Requires-Python >=3.8,<4.0; 1.2.1 Requires-Python >=3.8,<4.0; 2.0.0 Requires-Python >=3.8,<4.0
ERROR: Could not find a version that satisfies the requirement aiomqtt==2.0.0 (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 1.0.0, 1.1.0)
ERROR: No matching distribution found for aiomqtt==2.0.0
(env) vagrant@mqtt2kasaVM:~$ cat /etc/*release*
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

@normanr
Copy link
Contributor Author

normanr commented Jan 21, 2024

Thanks! Using an ordered comparison <= is better than equality ==, but I wonder if the comparable operator ~= (with the earliest compatible major.minor version) should be used instead. That way it'll pick up new micro or minor releases, but not the major release.

ref: https://packaging.python.org/en/latest/specifications/version-specifiers/#id4

@normanr
Copy link
Contributor Author

normanr commented Jan 21, 2024

fwiw, Python 3.7 support was dropped in sbtinstruments/aiomqtt#246 which is probably why it didn't detect it.

flavio-fernandes added a commit that referenced this issue Jan 22, 2024
Issue: #13
Incompatible with aiomqtt 2.0.0

This is a temporary fix, pending the implementation
of modifications mentioned in:
https://sbtinstruments.github.io/aiomqtt/migration-guide-v2.html

Co-authored-by: Norman Rasmussen <[email protected]>
Signed-off-by: Flavio Fernandes <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants