File tree 4 files changed +31
-12
lines changed
4 files changed +31
-12
lines changed Original file line number Diff line number Diff line change 40
40
poetry run pip install -U langchain langchain-core langchain_anthropic langchain_openai
41
41
- name : Build ${{ matrix.python-version }}
42
42
run : poetry build
43
+ - name : Check version alignment
44
+ run : make check-version
43
45
- name : Lint ${{ matrix.python-version }}
44
46
run : make lint
45
47
- name : Run Unit tests ${{ matrix.python-version }}
Original file line number Diff line number Diff line change @@ -77,3 +77,24 @@ api_docs_build:
77
77
78
78
api_docs_clean :
79
79
git clean -fd ./docs/
80
+
81
+ sync-version :
82
+ # Update version in __init__.py to match pyproject.toml
83
+ $(eval VERSION := $(shell grep '^version =' pyproject.toml | sed 's/version = "\(.* \) "/\1/') )
84
+ sed -i ' ' ' s/__version__ = "[^"]*"/__version__ = "$(VERSION)"/' langsmith/__init__.py
85
+ echo " Synced version: $( VERSION) "
86
+
87
+ check-version :
88
+ # Get version from pyproject.toml
89
+ $(eval VERSION := $(shell grep '^version =' pyproject.toml | sed 's/version = "\(.* \) "/\1/') )
90
+ # Get version from __init__.py
91
+ $(eval INIT_VERSION := $(shell grep '__version__ =' langsmith/__init__.py | sed 's/__version__ = "\(.* \) "/\1/') )
92
+ @echo " Checking version alignment..."
93
+ @echo " pyproject.toml version: $( VERSION) "
94
+ @echo " __init__.py version: $( INIT_VERSION) "
95
+ @if [ " $( VERSION) " = " $( INIT_VERSION) " ]; then \
96
+ echo " ✅ Versions are aligned" ; \
97
+ else \
98
+ echo " ❌ Version mismatch! Please run 'make sync-version' to sync versions" ; \
99
+ exit 1; \
100
+ fi
Original file line number Diff line number Diff line change 1
1
"""LangSmith Client."""
2
2
3
- from importlib import metadata
4
3
from typing import TYPE_CHECKING , Any
5
4
6
5
if TYPE_CHECKING :
18
17
)
19
18
from langsmith .run_trees import RunTree
20
19
from langsmith .testing ._internal import test , unit
21
- from langsmith .utils import (
22
- ContextThreadPoolExecutor ,
23
- )
20
+ from langsmith .utils import ContextThreadPoolExecutor
24
21
25
22
# Avoid calling into importlib on every call to __version__
26
- version = ""
27
- try :
28
- version = metadata .version (__package__ )
29
- except metadata .PackageNotFoundError :
30
- pass
23
+ __version__ = "0.3.31"
24
+ version = __version__ # for backwards compatibility
31
25
32
26
33
27
def __getattr__ (name : str ) -> Any :
@@ -108,9 +102,7 @@ def __getattr__(name: str) -> Any:
108
102
109
103
return unit
110
104
elif name == "ContextThreadPoolExecutor" :
111
- from langsmith .utils import (
112
- ContextThreadPoolExecutor ,
113
- )
105
+ from langsmith .utils import ContextThreadPoolExecutor
114
106
115
107
return ContextThreadPoolExecutor
116
108
Original file line number Diff line number Diff line change @@ -151,3 +151,7 @@ dynamic = ["version"]
151
151
152
152
[tool .poetry .plugins ."pytest11" ]
153
153
langsmith_plugin = " langsmith.pytest_plugin"
154
+
155
+ [tool .poetry_bumpversion .file ."langsmith/__init__ .py" ]
156
+ search = ' __version__ = "{current_version}"'
157
+ replace = ' __version__ = "{new_version}"'
You can’t perform that action at this time.
0 commit comments