# Overrides for optional-extras installs.
#
# neo4j-graphrag (pulled by langchain-neo4j) declares fsspec<2025, but the
# constraint is advisory only — newer fsspec/gcsfs/s3fs are fully compatible
# at runtime.  This override keeps them on their current releases instead of
# being downgraded to 2024.x.
#
# hugegraph-python==1.5.0 pins old versions of several common packages but
# those pins are advisory only — the newer versions are fully compatible.
# Without this override, installing .[langchain,langchain-extras] (which
# includes hugegraph-python) downgrades requests, urllib3, rich, setuptools,
# and decorator to significantly older releases.
#
# langchain-surrealdb 0.2.x pins surrealdb==1.0.8, langchain-core==1.1.3,
# and several llama-index-*/fsspec packages at older versions.
# All constraints are advisory only — the newer versions work at runtime.
#
# llama-index-spanner 0.1.5 declares llama-index (meta-package) as a dependency.
# The meta-package pins llama-index-* component packages at older versions and
# conflicts with this project's newer versions.  These overrides keep the
# component packages at their correct versions.  After installing, always run:
#   uv pip uninstall llama-index
# (the meta-package itself is harmless once its transitive pins are overridden,
# but removing it avoids confusion and future resolver surprises.)
#
# Usage:
#   uv pip install --override extras-overrides.txt -e ".[langchain,langchain-extras]"
#   uv pip install --override extras-overrides.txt -e ".[surrealdb-extras]" && uv pip install "surrealdb>=2.0" "langchain-core>=1.3"
#   uv pip install --override extras-overrides.txt -e ".[spanner-extras]"   && uv pip uninstall llama-index
#   # Or all at once:
#   uv pip install --override extras-overrides.txt -e ".[langchain,langchain-extras,surrealdb-extras,spanner-extras]" && uv pip install "surrealdb>=2.0" "langchain-core>=1.3" && uv pip uninstall llama-index

# ── Core packages pinned by multiple extras ───────────────────────────────────
fsspec>=2025.3.0
gcsfs>=2025.3.0
s3fs>=2025.3.0
pgvector>=0.4.2
requests>=2.33.0
urllib3>=2.6.0
rich>=15.0.0
setuptools>=81.0.0
decorator>=5.2.0
# omegaconf 2.3.0 (Dec 2022) hard-pins antlr4==4.9.* which conflicts with langchain-age==0.1.2.
# 2.4.0.dev10 (Apr 2026) uses antlr4>=4.11 — active development, just not formally released.
# rapidocr declares omegaconf!=2.2.1 (permissive), so dev10 satisfies it fine.
omegaconf>=2.4.0.dev10
# langchain-surrealdb 0.2.x pins langchain-core==1.1.3 — keep at 1.3+
langchain-core>=1.3.0
# langchain-age==0.1.2 requires antlr4>=4.11.  Pin to 0.1.2 (latest BAEM1N release).
# NOTE: PyPI also lists 0.2.0 by version number but it is a different package (uses
# apache-age-python + psycopg3 instead of the bundled _vendor/age ANTLR driver) with
# no corresponding GitHub release — do NOT upgrade to 0.2.0.
# Compatible with all extras including rapidocr — omegaconf>=2.4.0.dev10 override above
# allows rapidocr to satisfy omegaconf!=2.2.1 without landing on 2.3.0 (antlr4==4.9.*).
langchain-age==0.1.2
# langchain-age==0.1.2 uses ANTLR4-generated grammar files from apache/age (drivers/Agtype.g4).
# The ANTLR tool generates int-list ATN data with version=4 as the first element.
# Some builds of antlr4-python3-runtime==4.13.2 have SERIALIZED_VERSION=3 and fail on import;
# others have SERIALIZED_VERSION=4 and work without patching.
# Run scripts/patch_langchain_age.py after install — it makes no changes if the installed
# build already works, and applies the necessary fixes if it does not.
antlr4-python3-runtime==4.13.2

# ── easyocr transitive pins (pulled by langchain-arangodb) ───────────────────
# easyocr pins old versions of docling, pillow, pypdfium2, packaging, typer.
docling>=2.93.0
docling-parse>=5.10.1
pillow>=12.2.0
pypdfium2>=5.8.0
packaging>=26.0
typer>=0.21.0

# ── llama-index-spanner + langchain-surrealdb transitive pins ─────────────────
# Prevents the llama-index meta-package (pulled by llama-index-spanner) and
# langchain-surrealdb from downgrading these packages on a fresh install.
# Floors are set to the CURRENTLY INSTALLED version (not the downgraded version).
llama-index-embeddings-openai>=0.6.0
llama-index-embeddings-azure-openai>=0.5.2
llama-index-embeddings-fireworks>=0.5.2
llama-index-embeddings-openai-like>=0.3.1
llama-index-llms-openai>=0.6.26
llama-index-llms-azure-openai>=0.5.0
llama-index-llms-fireworks>=0.5.1
llama-index-readers-file>=0.6.0
llama-index-readers-gcs>=0.6.1
llama-index-readers-s3>=0.6.1
llama-index-readers-microsoft-sharepoint>=0.9.1
