Commit 1ab161c4 authored by Yan Zhaojun's avatar Yan Zhaojun
Browse files

update

parent 328de346
Pipeline #7744 failed with stage
in 0 seconds
__version__ = "3.0.1" __version__="3.0.1"
import setuptools import setuptools
import re
import os
def get_version():
# 找到 __init__.py 的路径
init_path = os.path.join(
os.path.dirname(__file__),
"csst_ifs_sim",
"__init__.py"
)
# 读取文件内容,使用正则找出版本号
with open(init_path, "r", encoding="utf-8") as f:
content = f.read()
version_match = re.search(r'^__version__ = ["\']([^"\']*)["\']', content, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("无法在 __init__.py 中找到 __version__ 定义")
# 读取README.md作为长描述 # 读取README.md作为长描述
with open("README.md", "r") as f: with open("README.md", "r") as f:
...@@ -16,7 +34,7 @@ with open("requirements.txt", "r") as f: ...@@ -16,7 +34,7 @@ with open("requirements.txt", "r") as f:
setuptools.setup( setuptools.setup(
name='csst_ifs_sim', # 包名 name='csst_ifs_sim', # 包名
version="3.0.1", # 版本号 version=get_version(), # 版本号
author="Zhaojun Yan", # 作者 author="Zhaojun Yan", # 作者
author_email="zhaojunyan@shao.ac.cn", # 邮箱 author_email="zhaojunyan@shao.ac.cn", # 邮箱
description="The CSST IFS simulation - prototype", # 短描述 description="The CSST IFS simulation - prototype", # 短描述
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment