Contributing¶
Dev environment setup¶
-
Clone the repository:
-
Install dependencies with uv:
This installs the project in development mode with all dev dependencies.
Running tests¶
Tests require 100% code coverage. To run the full suite:
To run a single test file or function:
To generate a coverage report with missing lines:
Linting and formatting¶
The max line length is 119 characters and line endings are LF, both configured in pyproject.toml.
Type checking¶
Some usearch-related type errors are downgraded to warnings in pyproject.toml because usearch has
incomplete type annotations.
Security scanning¶
assert statements are allowed (B101 is skipped) because the project uses them for parameter validation.
Documentation¶
Serve the docs locally with live reload:
Build for deployment:
Cross-platform support¶
All code, scripts, and dev tools must work on Linux, macOS, and Windows. Please test on multiple platforms when possible.
Patched usearch fork¶
iscc-usearch depends on a patched usearch fork, published on
PyPI as usearch-iscc and installed automatically as a
regular dependency. The required version is declared in
pyproject.toml.
Each patch is maintained on a separate branch to facilitate upstream merging:
fix-view-overhead— Fastview()with computed offsets, lazy key reindexing, and GIL release for parallel shard loadingpatch-index-get— ReturnNonefor non-existent keys inIndex.get()fix-search-count-zero— Validate search count parameter to prevent segfaultfix-serialized-length— Fixserialized_lengthpybind11 default argument bindingfix-array-copy-keyword— Acceptcopykeyword inIndexedKeys.__array__for NumPy 2.0python-128bit-keys— Add 128-bit (UUID) key support toIndexandIndexesviakey_kind="uuid"add-nphd-metric— NativeMetricKind.NPHDfor Normalized Prefix Hamming Distance
See the Performance explanation for details on the performance patches.