mirror of
https://github.com/hwchase17/langchain.git
synced 2026-04-26 09:53:41 +00:00
55 lines
1.7 KiB
YAML
55 lines
1.7 KiB
YAML
# Ensures version numbers in pyproject.toml and _version.py stay in sync.
|
|
#
|
|
# (Prevents releases with mismatched version numbers)
|
|
|
|
name: "Check Version Equality"
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- "libs/core/pyproject.toml"
|
|
- "libs/core/langchain_core/version.py"
|
|
- "libs/langchain_v1/pyproject.toml"
|
|
- "libs/langchain_v1/langchain/__init__.py"
|
|
- "libs/partners/*/pyproject.toml"
|
|
- "libs/partners/**/_version.py"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
check_version_equality:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: "Verify pyproject.toml & version files match"
|
|
run: |
|
|
FAILED=0
|
|
|
|
# langchain-core uses VERSION (not __version__) in version.py (not _version.py).
|
|
python .github/scripts/check_version.py libs/core \
|
|
--pattern VERSION --version-file version.py || FAILED=1
|
|
|
|
# langchain (v1) package dir is "langchain", not "langchain_*", so
|
|
# auto-detection won't find it — pass --package-name explicitly.
|
|
python .github/scripts/check_version.py libs/langchain_v1 \
|
|
--package-name langchain --pattern __version__ --version-file __init__.py || FAILED=1
|
|
|
|
# Partner packages all follow the default convention:
|
|
# __version__ in langchain_<pkg>/_version.py.
|
|
for pkg in anthropic openai groq deepseek xai fireworks mistralai ollama openrouter; do
|
|
python .github/scripts/check_version.py "libs/partners/$pkg" || FAILED=1
|
|
done
|
|
|
|
if [ "$FAILED" -ne 0 ]; then
|
|
echo ""
|
|
echo "One or more version checks failed!"
|
|
exit 1
|
|
fi
|