Closed nelsongraca closed 2 months ago
My initial reaction was negative: this is a python-can dependency, not a Klipper dependency. However, Klipper is pinned to an old version of python-can, and the current version does not have this import. The best way to resolve this error would be to move to a newer version of python-can, but that's a lot more work and would entail dropping support for Python < 3.7 (which is a good idea, but not a trivial decision.)
I think adding it as a dependency here is an acceptable workaround, but there should be a comment in the file about why this dependency is there. It also shouldn't be a strict version or marked as dependent on the version of Python, since it's always a dependency even if there was previously a non-dependency mechanism that installed it in some circumstances.
If newer versions of python-can
do not include this import then its version could be pinned conditionally, presuming there are no changes that break the API.
@Arksine I do like your suggestion, I have updated python-can
to 4.3.1 communication is working on my printer and currently printing.
The question that remains is, should I change this PR or just drop it and create a new one.
Dropped, please see: https://github.com/Klipper3d/klipper/pull/6557
In Python 3.12
setuptools
is no longer installed by default on virtual environment creation (see https://docs.python.org/3/whatsnew/3.12.html and https://github.com/python/cpython/issues/95299) This is breaking Klipper when connecting through CAN due to missing dependencies.This PR adds
setuptools
conditionally likegreenlet
already is.Klipper error as well to properly show the issue: