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 if: github.repository_owner == 'langchain-ai'23 runs-on: ubuntu-latest2425 steps:26 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v62728 - uses: astral-sh/setup-uv@0ca8f610542aa7f4acaf39e65cf4eb3c35091883 # v729 with:30 python-version: "3.12"3132 - name: "Verify pyproject.toml & version files match"33 run: |34 FAILED=03536 for dir in libs/core libs/langchain_v1 libs/partners/*; do37 [ -f "$dir/Makefile" ] || continue38 if grep -q '^check_version:' "$dir/Makefile"; then39 echo "--- $dir ---"40 make -C "$dir" check_version || FAILED=141 elif find "$dir" -maxdepth 2 -name '_version.py' -not -path '*/tests/*' \42 | grep -q .; then43 # A package ships a _version.py but has no way to verify it stays44 # in sync with pyproject.toml. Don't let it pass unchecked.45 echo "--- $dir ---"46 echo "Error: $dir has a _version.py but no 'check_version' Makefile target"47 FAILED=148 fi49 done5051 if [ "$FAILED" -ne 0 ]; then52 echo ""53 echo "One or more version checks failed!"54 exit 155 fi
Findings
✓ No findings reported for this file.