Open
Conversation
# Conflicts: # pyproject.toml # python/usearch/__init__.py # python/usearch/index.py
ashvardanian
reviewed
Apr 5, 2026
setup.py
Outdated
| install_requires = [ | ||
| "numpy", | ||
| "tqdm", | ||
| "ucall", |
Contributor
There was a problem hiding this comment.
Let's avoid this dependency
Author
There was a problem hiding this comment.
Ucall is used a lot inside library. Is it expected to be an optional dependency?
python/usearch/numba.py
Outdated
Comment on lines
+30
to
+41
| 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) | ||
| ) |
Contributor
There was a problem hiding this comment.
Our lines are 120 lines wide - surprised that this is warping 🤔
Author
|
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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