Skip to content

feat!: lazy usearch initialization (v0.1.0 BREAKING)#10

Open
27Bslash6 wants to merge 2 commits intoKarthik777:mainfrom
27Bslash6:feat/lazy-usearch-init
Open

feat!: lazy usearch initialization (v0.1.0 BREAKING)#10
27Bslash6 wants to merge 2 commits intoKarthik777:mainfrom
27Bslash6:feat/lazy-usearch-init

Conversation

@27Bslash6
Copy link
Copy Markdown

Summary

BREAKING CHANGE: usearch_fix() no longer runs automatically on import.

This PR removes the subprocess call that runs on every import litesearch, making imports clean and side-effect free.

Why This Matters

The current behavior runs install_name_tool (macOS) on every import, which:

  • Breaks multiprocessing contexts (subprocess on fork)
  • Fails in restricted environments (containers, CI)
  • Surprises users with system modifications on innocent imports
  • Prevents using litesearch without usearch installed

Migration

# Old (v0.0.x) - implicit, runs on import
import litesearch  # usearch_fix() ran here

# New (v0.1.0) - Option 1: automatic on first use (recommended)
db = setup_db('mydb.db', sem_search=True)  # fix applied here

# New (v0.1.0) - Option 2: explicit call if needed
import litesearch
litesearch.usearch_fix()  # call manually before setup_db

Changes

  • Remove usearch_fix() call from __init__.py
  • Keep usearch_fix importable for explicit use
  • Add 4 import safety tests
  • Version bump to 0.1.0

Dependencies

Test Plan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant