Repository navigation
Conversation
# Conflicts: # pyproject.toml # python/usearch/__init__.py # python/usearch/index.py
| install_requires = [ | ||
| "numpy", | ||
| "tqdm", | ||
| "ucall", |
There was a problem hiding this comment.
Let's avoid this dependency
There was a problem hiding this comment.
Ucall is used a lot inside library. Is it expected to be an optional dependency?
| signature_i8args = types.float32( | ||
| types.CPointer(types.int8), types.CPointer(types.int8) | ||
| ) | ||
| signature_f16args = types.float32( | ||
| types.CPointer(types.float16), types.CPointer(types.float16) | ||
| ) | ||
| signature_f32args = types.float32( | ||
| types.CPointer(types.float32), types.CPointer(types.float32) | ||
| ) | ||
| signature_f64args = types.float32( | ||
| types.CPointer(types.float64), types.CPointer(types.float64) | ||
| ) |
There was a problem hiding this comment.
Our lines are 120 lines wide - surprised that this is warping 🤔
|
When I tried to build this on mac I got error and I fixed it with from setuptools.command.build_ext import build_ext as _build_ext
# Flags that are only valid for C++ compilation
cpp_only_flags = {"-std=c++17", "/std:c++17"}
class MixedBuildExt(_build_ext):
"""Build extension that applies C++-only flags only to C++ source files."""
def build_extension(self, ext):
original_compile = self.compiler.compile
def patched_compile(sources, **kwargs):
c_sources = [s for s in sources if not s.endswith((".cpp", ".cxx", ".cc"))]
cpp_sources = [s for s in sources if s.endswith((".cpp", ".cxx", ".cc"))]
objects = []
extra_args = kwargs.get("extra_postargs", [])
if c_sources:
c_kwargs = dict(kwargs)
c_kwargs["extra_postargs"] = [f for f in extra_args if f not in cpp_only_flags]
objects += original_compile(c_sources, **c_kwargs)
if cpp_sources:
objects += original_compile(cpp_sources, **kwargs)
return objects
self.compiler.compile = patched_compile
try:
_build_ext.build_extension(self, ext)
finally:
self.compiler.compile = original_compile
setup(
...,
cmdclass={"build_ext": MixedBuildExt},
)Not sure if it is good (I asked to fix claude), but I thought you might be interested |
|
@Samoed, thanks for pushing on typing early! 3.0 ships a complete stub, |
|
Oh, great! Sorry, I had a bit busy time and forgot about this pr |
Make library fully typechexked. Integrate mypy typcheking for this. Not sure how much it is correct, because there is no tests. Maybe would be better to create tests firstly