SilvairGit / python-bluetooth-mesh

https://pypi.org/project/bluetooth-mesh/
GNU General Public License v2.0
71 stars 22 forks source link

very old version installed with Python 3.8.5 #121

Open markus-becker-tridonic-com opened 3 years ago

markus-becker-tridonic-com commented 3 years ago

When issuing pip install bluetooth_mesh version 0.1.29 is getting installed:

Collecting bluetooth_mesh
[...]
Installing collected packages: bluetooth-mesh
Successfully installed bluetooth-mesh-0.1.29

When trying to deliberately install 0.7.2:

pip install bluetooth_mesh==0.7.2  
ERROR: Could not find a version that satisfies the requirement bluetooth_mesh==0.7.2 (from versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.8, 0.1.9, 0.1.10, 0.1.11, 0.1.12, 0.1.13, 0.1.14, 0.1.15, 0.1.16, 0.1.17, 0.1.18, 0.1.19, 0.1.20, 0.1.21, 0.1.22, 0.1.23, 0.1.24, 0.1.25, 0.1.26, 0.1.27, 0.1.28, 0.1.29)
ERROR: No matching distribution found for bluetooth_mesh==0.7.2

It seems Python 3.8.5 is not supported:

  Link requires a different Python (3.8.5 not in: '>=3.6.0,<3.8.0'): https://files.pythonhosted.org/packages/d2/b8/033429bfecccd8de9f867f57491cc1ac76b3e51b639e16327332233fd94c/bluetooth-mesh-0.7.2.tar.gz#sha256=26f24a22461b14cba1775c7a358c5d4b07b5961aadf6cf756db111f415a45657 (from https://pypi.org/simple/bluetooth-mesh/) (requires-python:>=3.6.0,<3.8.0)

Any particular reason why?

michallowasrzechonek-silvair commented 3 years ago

This package doesn't support python 3.8 at the moment.

We had issues with SSL api in newer pythons. It might be possible to isolate this dependency, but at the moment we're using 3.7 for everything.

markus-becker-tridonic-com commented 3 years ago

@michallowasrzechonek-silvair Wanna document that dependency in the README?

What is the issue with the SSL API?

michallowasrzechonek-silvair commented 3 years ago

https://github.com/drbild/sslpsk doesn't work on older pythons, and we use that to run tests against bluez

markus-becker-tridonic-com commented 3 years ago

https://github.com/drbild/sslpsk/pull/14#issuecomment-776700116 would likely solve it for Python 3.8

michallowasrzechonek-silvair commented 3 years ago

It does the trick for 3.7, but for 3.8 it's way more complicated unfortunately.

AFAIK, 3.8 uses a different IO API than 3.7, so ssl.wrap_socket is no longer useful. I think they did that to better support SSL connections under an event loop (asyncio). During SSL connection, it might be necessary to perform write operations when waiting for reading, and OpenSSL's pseudo-sockets were hiding that from the loop's reactor.

michallowasrzechonek-silvair commented 3 years ago

https://docs.python.org/3/library/ssl.html#ssl.wrap_socket

Also, see the section desribing the Memory BIO