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
yujq2
AutoAWQ_kernels
Commits
78789784
Commit
78789784
authored
Sep 27, 2024
by
yangql
Browse files
Update setup.py
parent
e1e4fabd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
setup.py
setup.py
+6
-1
No files found.
setup.py
View file @
78789784
...
...
@@ -71,7 +71,12 @@ def get_version_add(sha: Optional[str] = None) -> str:
with
open
(
add_version_path
,
'r'
,
encoding
=
'utf-8'
)
as
file
:
lines
=
file
.
readlines
()
lines
[
1
]
=
"__dcu_version__ = '0.0.6+{}'
\n
"
.
format
(
version
)
if
len
(
lines
)
>
1
:
lines
[
1
]
=
"__dcu_version__ = '0.0.6+{}'
\n
"
.
format
(
version
)
else
:
# 如果文件行数不足,可以选择添加空行或者抛出异常
lines
.
append
(
"__dcu_version__ = '0.0.6+{}'
\n
"
.
format
(
version
))
print
(
"Added missing line to the file content."
)
with
open
(
add_version_path
,
encoding
=
"utf-8"
,
mode
=
"w"
)
as
file
:
file
.
writelines
(
lines
)
file
.
close
()
...
...
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