File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed
Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -10,4 +10,5 @@ sphinxcontrib-htmlhelp
1010sphinxcontrib-jsmath
1111nbsphinx == 0.9
1212graphviz == 0.20
13+ setuptools-scm # 自动从git tag中构建版本
1314git+https://github.com/Dengda98/PyFMM.git # 包本身
Original file line number Diff line number Diff line change 88
99import sys , os , pathlib
1010import subprocess
11+ import setuptools_scm
1112
1213read_the_docs_build = os .environ .get ('READTHEDOCS' , None ) == 'True'
1314
1718
1819html_last_updated_fmt = '%b %d, %Y'
1920
20- # 引入版本信息
21- version = os .getenv ('READTHEDOCS_VERSION' , 'local' )
22- release = version
23- # version = "0.1"
24-
25-
2621def setup (app ):
2722 app .add_css_file ('my_theme.css' )
2823
2924
3025project = 'PyFMM'
3126copyright = '2023, Zhu Dengda'
3227author = 'Zhu Dengda'
33- release = 'v0.1'
34-
28+ # 引入版本信息
29+ version = setuptools_scm .get_version (root = '../..' , relative_to = __file__ )
30+ release = version
3531
3632# -- General configuration ---------------------------------------------------
3733# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ def run(self):
3131
3232setup (
3333 name = 'pyfmm' ,
34- version = '0.1' ,
34+ use_scm_version = True , # 自动使用 Git 标签作为版本号
35+ setup_requires = ['setuptools-scm' ],
3536 description = 'Your package description' ,
3637 author = 'Zhu Dengda' ,
3738
You can’t perform that action at this time.
0 commit comments