Skip to content

Commit d419a1b

Browse files
Kangyan-Zhouclaude
andcommitted
fix(ci): install tomli for version bump workflows
The version bump scripts now use tomli/tomllib to parse TOML files properly. Since GitHub Actions runners use Python 3.10 which doesn't have the built-in tomllib module, we need to install the tomli package. This ensures the workflows can run successfully when bumping versions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 93549e9 commit d419a1b

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.github/workflows/bot-bump-kernel-version.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
with:
2727
python-version: '3.10'
2828

29+
- name: Install Python dependencies
30+
run: |
31+
pip install tomli
32+
2933
- name: Configure Git and branch
3034
run: |
3135
git config user.name "sglang-bot"

.github/workflows/bot-bump-sglang-version.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ jobs:
2626
with:
2727
python-version: '3.10'
2828

29+
- name: Install Python dependencies
30+
run: |
31+
pip install tomli
32+
2933
- name: Configure Git and branch
3034
run: |
3135
git config user.name "sglang-bot"

scripts/release/utils.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,18 +106,17 @@ def replace_in_file(file_path: Path, old_version: str, new_version: str) -> bool
106106

107107
# Check if [project] section exists and has version field
108108
if "project" not in toml_data or "version" not in toml_data["project"]:
109-
print(f"Warning: {file_path} does not have [project] version field, skipping")
109+
print(
110+
f"Warning: {file_path} does not have [project] version field, skipping"
111+
)
110112
return False
111113

112114
# Use regex to replace only the version field in [project] section
113115
# This pattern matches the version field that comes after [project]
114116
# and before any other section marker
115117
pattern = r'(\[project\].*?version\s*=\s*)["\']([^"\']+)["\']'
116118
new_content = re.sub(
117-
pattern,
118-
rf'\g<1>"{new_version}"',
119-
content,
120-
flags=re.DOTALL
119+
pattern, rf'\g<1>"{new_version}"', content, flags=re.DOTALL
121120
)
122121
except Exception as e:
123122
print(f"Warning: Failed to parse {file_path} as TOML: {e}")

0 commit comments

Comments
 (0)