mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-04-06 06:03:54 +08:00
install libusb from pip (#2351)
* install libusb from pip Use libusb-package to bundle libusb as a Python dependency instead of requiring it as a system package. This simplifies setup on all platforms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix agnos --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ classifiers = [
|
||||
]
|
||||
dependencies = [
|
||||
"libusb1",
|
||||
"libusb-package",
|
||||
"opendbc @ git+https://github.com/commaai/opendbc.git@master#egg=opendbc",
|
||||
|
||||
# runtime dependency on comma four
|
||||
|
||||
@@ -6,6 +6,7 @@ import usb1
|
||||
import struct
|
||||
import hashlib
|
||||
import binascii
|
||||
import ctypes
|
||||
from functools import wraps, partial
|
||||
from itertools import accumulate
|
||||
|
||||
@@ -18,6 +19,14 @@ from .spi import PandaSpiHandle, PandaSpiException, PandaProtocolMismatch
|
||||
from .usb import PandaUsbHandle
|
||||
from .utils import logger
|
||||
|
||||
# load libusb from pip package
|
||||
try:
|
||||
import libusb_package
|
||||
usb1._libusb1.loadLibrary(ctypes.CDLL(str(libusb_package.get_library_path())))
|
||||
except ImportError:
|
||||
# TODO: remove this on next AGNOS update
|
||||
pass
|
||||
|
||||
__version__ = '0.0.10'
|
||||
|
||||
CANPACKET_HEAD_SIZE = 0x6
|
||||
|
||||
Reference in New Issue
Block a user