Skip to content

Commit e81f594

Browse files
committed
Improve: Expose library version in Python
1 parent 4c1663d commit e81f594

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

python/lib.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,10 @@ PYBIND11_MODULE(compiled, m) {
862862
m.attr("USES_SIMSIMD") = py::int_(USEARCH_USE_SIMSIMD);
863863
m.attr("USES_FP16LIB") = py::int_(USEARCH_USE_FP16LIB);
864864

865+
m.attr("VERSION_MAJOR") = py::int_(USEARCH_VERSION_MAJOR);
866+
m.attr("VERSION_MINOR") = py::int_(USEARCH_VERSION_MINOR);
867+
m.attr("VERSION_PATCH") = py::int_(USEARCH_VERSION_PATCH);
868+
865869
py::enum_<metric_punned_signature_t>(m, "MetricSignature")
866870
.value("ArrayArray", metric_punned_signature_t::array_array_k)
867871
.value("ArrayArraySize", metric_punned_signature_t::array_array_size_k);

python/usearch/__init__.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from usearch.compiled import (
2+
VERSION_MAJOR,
3+
VERSION_MINOR,
4+
VERSION_PATCH,
5+
)
6+
7+
__version__ = f"{VERSION_MAJOR}.{VERSION_MINOR}.{VERSION_PATCH}"

0 commit comments

Comments
 (0)