-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
[Request]: Update Discovery plugin to be python3 compatible #3664
Comments
python-zeroconf is what is used in Cura, though Cura uses it for discovery as opposed to advertising itself (which is what OctoPrint would do). It is actively maintained and the maintainers are open to (well-tested) PRs if needed. |
Looks like porting over to python-zeroconf is fairly straight forward, I just threw around 2h at it and it's already looking very shippable. Just need to test the discovery helpers.
|
Well, that was easy. Implemented on |
From experience with Cura, there might be some serious performance issues on certain networks with versions 0.18-0.24: These were fixed here: Would you be open to a solution where Python 2 instances use pybonjour and Python 3 instances use python-zeroconf? |
It looks like this only relates to browsing, which is only exposed via a helper and not used by any bundled plugins. So the risk of this causing issues is probably fairly small. An alternative to a python version specific switch would be to vendor bundle it for 1.4.x and apply the changes from the PR to the bundled version. |
👍 |
So, slightly changed here. Vendored lib for Py2, adjusted by the aforementioned performance patch plus some minor equality check fixes and also a bit of backporting of some method signatures to allow one client code for both the vendored lib and the officially maintained one. The latter will be automatically used under Py3. |
Make that 1.4.3, 1.4.2 just got turned into a hotfix release. |
Actually make that 1.5.0 because I've decided to finally fully adhere to semver and maintenance releases will see a minor increase in the future instead of patch, patch will be used for hotfixes if needed. |
Is your feature request related to a problem? Please describe.
Right now the built-in Discovery plugin depends on pybonjour for Bonjour/Zeroconf, which is only compatible with python2. As python2 has been deprecated and OctoPrint has been moving towards python3 compatibility, it would be nice to not lose support for Zeroconf.
Describe the solution you'd like
This line in the plugin suggests either porting pybonjour to python3 or to find an alternative. Personally, I would like to see a library that has had active contributions in the past decade as opposed to porting pybonjour. A quick search has turned up python-zeroconf as a potential replacement that is actively developed.
Describe alternatives you've considered
Alternatively, pybonjour could be modernized enough to run against python3. It seems there was a previous attempt, though it doesn't seem that it's been touched in about 7 years.
Additional context
None at the moment, though I might try to give it a shot updating the plugin to python-zeroconf.
The text was updated successfully, but these errors were encountered: