Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
csst-sims
csst_ifs_sim
Commits
1ab161c4
Commit
1ab161c4
authored
Jan 08, 2025
by
Yan Zhaojun
Browse files
update
parent
328de346
Pipeline
#7744
failed with stage
in 0 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
csst_ifs_sim/__init__.py
View file @
1ab161c4
__version__
=
"3.0.1"
__version__
=
"3.0.1"
setup.py
View file @
1ab161c4
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"
,
# 短描述
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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