Skip to content

Commit 909435f

Browse files
committed
readme: document get_library_path(); versioning; note about sdist.
1 parent b7949ed commit 909435f

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ project that uses a libusb wrapper can also benefit.
88

99
## APIs
1010

11-
There are three public functions exported by `libusb_package`.
11+
There are four public functions exported by `libusb_package`.
1212

1313
- `find(*args, **kwargs)`: Wrapper around pyusb's `usb.core.find()` that sets the `backend`
1414
parameter to a libusb1 backend created from the libusb library included in `libusb_package`.
@@ -22,7 +22,20 @@ There are three public functions exported by `libusb_package`.
2222
no matching library is found. This function is suitable for use with the `find_library`
2323
callback parameter for pyusb's `get_backend()` functions.
2424

25-
Both `get_libusb1_backend()` and `find_library(candidate)` cache their return values.
25+
If `get_library_path()` returns None, indicating there is no included library, this function
26+
will fall back to `ctypes.util.find_library()`.
27+
28+
- `get_library_path()`: Returns an absolute Path object for the included library. If there is not
29+
an included library, None is returned.
30+
31+
Both `get_libusb1_backend()` and `get_library_path()` cache their return values.
32+
33+
34+
## Versioning
35+
36+
The version of libusb-package is composed of the libusb version plus an additional field for
37+
the version of the Python code. For instance, 1.0.24.0. The Python code version will be reset
38+
to 0 when the libusb version is incremented for new libusb release.
2639

2740

2841
## Examples
@@ -61,3 +74,7 @@ print(list(usb.core.find(find_all=True, backend=libusb1_backend)))
6174
```
6275

6376

77+
### Source distribution
78+
79+
Before building a source distribution, be sure to clean all untracked files from the libusb
80+
submodule using `git -C src/libusb clean -dfx`.

0 commit comments

Comments
 (0)