From 406ac2a182cf699a53a2ff067ac04c9891f34a4c Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 25 Jul 2022 01:25:17 +0800 Subject: [PATCH] ok --- run_tags_add.py | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/run_tags_add.py b/run_tags_add.py index 94855c4..a82a6f2 100644 --- a/run_tags_add.py +++ b/run_tags_add.py @@ -78,19 +78,18 @@ def main(): print(cmd) os.system(cmd) - # 替换文本内容 __version__ = '1.2.5' - # 打开文件 pyefun/__init__.py - # with open("pyefun/__init__.py", "r") as f: - # lines = f.readlines() - # # 找到版本号的行 - # for i, line in enumerate(lines): - # if '__version__' in line: - # # 找到版本号的行 - # version_line = i - # break - # # 替换版本号 - # lines[version_line] = f"__version__ = '{新版本号}'\n" - # + 替换文本内容 __version__ = '1.2.5' + 打开文件 pyefun/__init__.py + with open("pyefun/__init__.py", "r") as f: + lines = f.readlines() + # 找到版本号的行 + for i, line in enumerate(lines): + if '__version__' in line: + # 找到版本号的行 + version_line = i + break + # 替换版本号 + lines[version_line] = f"__version__ = '{新版本号}'\n"