Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
53529f46
Unverified
Commit
53529f46
authored
Oct 19, 2025
by
Kangyan-Zhou
Committed by
GitHub
Oct 19, 2025
Browse files
Fix version bump script to handle TOML files with outdated versions (#11787)
Co-authored-by:
Claude
<
noreply@anthropic.com
>
parent
24ed3f32
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
2 deletions
+46
-2
scripts/release/bump_sglang_version.py
scripts/release/bump_sglang_version.py
+0
-1
scripts/release/utils.py
scripts/release/utils.py
+46
-1
No files found.
scripts/release/bump_sglang_version.py
View file @
53529f46
...
@@ -19,7 +19,6 @@ def main():
...
@@ -19,7 +19,6 @@ def main():
version_file
=
Path
(
"python/sglang/version.py"
)
version_file
=
Path
(
"python/sglang/version.py"
)
files_to_update
=
[
files_to_update
=
[
Path
(
"Makefile"
),
Path
(
"benchmark/deepseek_v3/README.md"
),
Path
(
"benchmark/deepseek_v3/README.md"
),
Path
(
"docker/Dockerfile.rocm"
),
Path
(
"docker/Dockerfile.rocm"
),
Path
(
"docs/get_started/install.md"
),
Path
(
"docs/get_started/install.md"
),
...
...
scripts/release/utils.py
View file @
53529f46
...
@@ -92,7 +92,16 @@ def replace_in_file(file_path: Path, old_version: str, new_version: str) -> bool
...
@@ -92,7 +92,16 @@ def replace_in_file(file_path: Path, old_version: str, new_version: str) -> bool
return
False
return
False
content
=
file_path
.
read_text
()
content
=
file_path
.
read_text
()
new_content
=
content
.
replace
(
old_version
,
new_version
)
# For TOML files, use regex to match version field regardless of current value
if
file_path
.
suffix
==
".toml"
:
# Match: version = "X.Y.Z..." (with optional quotes and whitespace)
# Captures quotes (or lack thereof) to preserve original quoting style
pattern
=
r
'(version\s*=\s*)(["\']?)([^"\'\n]+)(["\']?)'
new_content
=
re
.
sub
(
pattern
,
rf
"\g<1>\g<2>
{
new_version
}
\g<4>"
,
content
)
else
:
# For non-TOML files, use simple string replacement
new_content
=
content
.
replace
(
old_version
,
new_version
)
if
content
==
new_content
:
if
content
==
new_content
:
print
(
f
"No changes needed in
{
file_path
}
"
)
print
(
f
"No changes needed in
{
file_path
}
"
)
...
@@ -150,3 +159,39 @@ def bump_version(
...
@@ -150,3 +159,39 @@ def bump_version(
print
()
print
()
print
(
f
"Successfully updated
{
updated_count
}
file(s)"
)
print
(
f
"Successfully updated
{
updated_count
}
file(s)"
)
print
(
f
"Version bumped from
{
old_version
}
to
{
new_version
}
"
)
print
(
f
"Version bumped from
{
old_version
}
to
{
new_version
}
"
)
# Validate that all files now contain the new version
print
(
"
\n
Validating version updates..."
)
failed_files
=
[]
for
file_rel
in
files_to_update
:
file_abs
=
repo_root
/
file_rel
if
not
file_abs
.
exists
():
print
(
f
"Warning: File
{
file_rel
}
does not exist, skipping validation."
)
continue
content
=
file_abs
.
read_text
()
# For TOML files, use regex to specifically check the version field
if
file_abs
.
suffix
==
".toml"
:
# Match version field with optional quotes
pattern
=
r
'version\s*=\s*["\']?'
+
re
.
escape
(
new_version
)
+
r
'["\']?'
if
not
re
.
search
(
pattern
,
content
):
failed_files
.
append
(
file_rel
)
print
(
f
"✗
{
file_rel
}
does not contain version
{
new_version
}
"
)
else
:
print
(
f
"✓
{
file_rel
}
validated"
)
else
:
# For non-TOML files, use simple string search
if
new_version
not
in
content
:
failed_files
.
append
(
file_rel
)
print
(
f
"✗
{
file_rel
}
does not contain version
{
new_version
}
"
)
else
:
print
(
f
"✓
{
file_rel
}
validated"
)
if
failed_files
:
print
(
f
"
\n
Error:
{
len
(
failed_files
)
}
file(s) were not updated correctly:"
)
for
file_rel
in
failed_files
:
print
(
f
" -
{
file_rel
}
"
)
sys
.
exit
(
1
)
print
(
"
\n
All files validated successfully!"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment