1# Ensures version numbers in pyproject.toml and _version.py stay in sync.2#3# (Prevents releases with mismatched version numbers)45name: "Check Version Equality"67on:8 pull_request:9 paths:10 - "libs/core/pyproject.toml"11 - "libs/core/langchain_core/version.py"12 - "libs/langchain_v1/pyproject.toml"13 - "libs/langchain_v1/langchain/__init__.py"14 - "libs/partners/*/pyproject.toml"15 - "libs/partners/**/_version.py"1617permissions:18 contents: read1920jobs:21 check_version_equality:22 runs-on: ubuntu-latest2324 steps:25 - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v62627 - uses: astral-sh/setup-uv@0ca8f610542aa7f4acaf39e65cf4eb3c35091883 # v728 with:29 python-version: "3.12"3031 - name: "Verify pyproject.toml & version files match"32 run: |33 FAILED=03435 for dir in libs/core libs/langchain_v1 libs/partners/*; do36 [ -f "$dir/Makefile" ] || continue37 if grep -q '^check_version:' "$dir/Makefile"; then38 echo "--- $dir ---"39 make -C "$dir" check_version || FAILED=140 elif find "$dir" -maxdepth 2 -name '_version.py' -not -path '*/tests/*' \41 | grep -q .; then42 # A package ships a _version.py but has no way to verify it stays43 # in sync with pyproject.toml. Don't let it pass unchecked.44 echo "--- $dir ---"45 echo "Error: $dir has a _version.py but no 'check_version' Makefile target"46 FAILED=147 fi48 done4950 if [ "$FAILED" -ne 0 ]; then51 echo ""52 echo "One or more version checks failed!"53 exit 154 fi
Findings
✓ No findings reported for this file.