fix(python): set LsmWriteSpec module metadata (#3995)

PyO3 exposed `LsmWriteSpec` with its default `builtins` module, causing
mkdocstrings to resolve the public `lancedb.LsmWriteSpec` re-export as
`builtins.LsmWriteSpec` and fail the documentation build. Declare the
native extension module and pin the public re-export with a regression
test.

This also applies the repository's current Ruff formatter to seven
previously unformatted Python scripts.
This commit is contained in:
Xuanwo
2026-08-21 16:37:48 +08:00
committed by GitHub
parent c1331e5083
commit 7adcffc2b4
9 changed files with 39 additions and 16 deletions
@@ -64,7 +64,9 @@ def scan_python(path: Path, text: str) -> list[Finding]:
def statement_around(text: str, start: int, end: int) -> str:
before = max(text.rfind(";", 0, start), text.rfind("\n\n", 0, start))
after_candidates = [pos for pos in (text.find(";", end), text.find("\n\n", end)) if pos != -1]
after_candidates = [
pos for pos in (text.find(";", end), text.find("\n\n", end)) if pos != -1
]
after = min(after_candidates) if after_candidates else len(text)
return text[before + 1 : after].strip()