mirror of
https://github.com/hwchase17/langchain.git
synced 2025-10-23 11:16:58 +00:00
release(text-splitters): 0.3.11 (#32770)
Fixes #32747 SpaCy integration test fixture was trying to use pip to download the SpaCy language model (`en_core_web_sm`), but uv-managed environments don't include pip by default. Fail test if not installed as opposed to downloading.
This commit is contained in:
@@ -20,7 +20,18 @@ def spacy() -> Any:
|
||||
import spacy
|
||||
except ImportError:
|
||||
pytest.skip("Spacy not installed.")
|
||||
spacy.cli.download("en_core_web_sm") # type: ignore[attr-defined,operator,unused-ignore]
|
||||
|
||||
# Check if en_core_web_sm model is available
|
||||
try:
|
||||
spacy.load("en_core_web_sm")
|
||||
except OSError:
|
||||
pytest.skip(
|
||||
"en_core_web_sm model not installed. Install with: "
|
||||
"uv add --group test_integration "
|
||||
"https://github.com/explosion/spacy-models/releases/download/"
|
||||
"en_core_web_sm-3.8.0/en_core_web_sm-3.8.0-py3-none-any.whl"
|
||||
)
|
||||
|
||||
return spacy
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user