File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed
Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 11"""Main entrypoint into LangChain."""
22
3- __version__ = "1.2.0 "
3+ __version__ = "1.2.2 "
Original file line number Diff line number Diff line change 1+ """Test that package version is consistent across configuration files."""
2+
3+ from pathlib import Path
4+
5+ import toml
6+
7+ import langchain
8+
9+
10+ def test_version_matches_pyproject () -> None :
11+ """Verify that __version__ in __init__.py matches version in pyproject.toml."""
12+ # Get the version from the package __init__.py
13+ init_version = langchain .__version__
14+
15+ # Read the version from pyproject.toml
16+ pyproject_path = Path (__file__ ).parent .parent .parent / "pyproject.toml"
17+ with pyproject_path .open () as f :
18+ pyproject_data = toml .load (f )
19+
20+ pyproject_version = pyproject_data ["project" ]["version" ]
21+
22+ # Assert they match
23+ assert init_version == pyproject_version , (
24+ f"Version mismatch: __init__.py has '{ init_version } ' but "
25+ f"pyproject.toml has '{ pyproject_version } '. "
26+ f"Please update langchain/__init__.py to match pyproject.toml."
27+ )
You can’t perform that action at this time.
0 commit comments