add support for version

This commit is contained in:
Adrien Béraud committed 2025-09-04 23:22:34 -04:00
1 parent 0139e7a2d4
commit c08b6a7f5d
3 files changed
+5

No files matched your search

+3
View File
@@ -48,6 +48,9 @@ cdef inline _deinitialize_gnutls():
# Initialize GnuTLS when this module is imported
_initialize_gnutls()
def version() -> str:
return cpp.version().decode()
cdef inline void lookup_callback(cpp.vector[cpp.shared_ptr[cpp.IndexValue]]* values, cpp.Prefix* p, void *user_data) noexcept with gil:
cbs = <object>user_data
if 'lookup' in cbs and cbs['lookup']:
+1
View File
@@ -8,4 +8,5 @@ pure-Python asyncio-friendly wrapper under ``opendht.aio``.
from ._core import * # re-export core Cython bindings
__version__ = version()
__all__ = [name for name in dir() if not name.startswith("_")]
+1
View File
@@ -49,6 +49,7 @@ cdef extern from "<future>" namespace "std" nogil:
shared_future[T] share()
cdef extern from "opendht/utils.h" namespace "dht":
const char* version()
cdef cppclass time_point:
@staticmethod
time_point min() const