Skip to content

Commit 1c8b4d5

Browse files
examples
1 parent a31a899 commit 1c8b4d5

File tree

3 files changed

+82
-3
lines changed

3 files changed

+82
-3
lines changed

examples/10_mcp_ollama_demo/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ COPY . /vallm
1818
WORKDIR /vallm
1919

2020
# Install additional dependencies
21-
RUN pip install --no-cache-dir code2llm code2logic requests
21+
COPY examples/10_mcp_ollama_demo/requirements.txt /tmp/
22+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
2223

2324
# Install vallm in editable mode
2425
RUN pip install -e ".[llm]"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
vallm[llm]>=0.1.5
2-
code2llm>=0.1.0
3-
code2logic>=0.1.0
2+
code2llm>=0.5.4
3+
code2logic>=1.0.48
44
requests>=2.31.0

scripts/bump_version.py

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Version bump script for vallm package.
4+
Updates version in pyproject.toml based on the specified bump type.
5+
"""
6+
7+
import sys
8+
import re
9+
from pathlib import Path
10+
11+
12+
def bump_version(version_str, bump_type):
13+
"""Bump version string based on type."""
14+
# Parse version string (expected format: X.Y.Z)
15+
match = re.match(r'^(\d+)\.(\d+)\.(\d+)$', version_str)
16+
if not match:
17+
raise ValueError(f"Invalid version format: {version_str}")
18+
19+
major, minor, patch = map(int, match.groups())
20+
21+
if bump_type == "patch":
22+
patch += 1
23+
elif bump_type == "minor":
24+
minor += 1
25+
patch = 0
26+
elif bump_type == "major":
27+
major += 1
28+
minor = 0
29+
patch = 0
30+
else:
31+
raise ValueError(f"Invalid bump type: {bump_type}")
32+
33+
return f"{major}.{minor}.{patch}"
34+
35+
36+
def main():
37+
if len(sys.argv) != 2:
38+
print("Usage: python bump_version.py <patch|minor|major>")
39+
sys.exit(1)
40+
41+
bump_type = sys.argv[1]
42+
if bump_type not in ["patch", "minor", "major"]:
43+
print("Error: bump_type must be one of: patch, minor, major")
44+
sys.exit(1)
45+
46+
# Read pyproject.toml
47+
pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
48+
if not pyproject_path.exists():
49+
print(f"Error: {pyproject_path} not found")
50+
sys.exit(1)
51+
52+
content = pyproject_path.read_text()
53+
54+
# Find current version
55+
version_match = re.search(r'^version\s*=\s*"([^"]+)"', content, re.MULTILINE)
56+
if not version_match:
57+
print("Error: version not found in pyproject.toml")
58+
sys.exit(1)
59+
60+
current_version = version_match.group(1)
61+
new_version = bump_version(current_version, bump_type)
62+
63+
# Update version in content
64+
new_content = re.sub(
65+
r'^version\s*=\s*"([^"]+)"',
66+
f'version = "{new_version}"',
67+
content,
68+
flags=re.MULTILINE
69+
)
70+
71+
# Write back to file
72+
pyproject_path.write_text(new_content)
73+
74+
print(f"Bumped {bump_type} version: {current_version}{new_version}")
75+
76+
77+
if __name__ == "__main__":
78+
main()

0 commit comments

Comments
 (0)