File tree Expand file tree Collapse file tree 5 files changed +21
-11
lines changed
Expand file tree Collapse file tree 5 files changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -11,4 +11,4 @@ sphinxcontrib-jsmath==1.0
1111nbsphinx == 0.9
1212graphviz == 0.20
1313setuptools-scm == 8.1 # 自动从git tag中构建版本
14- git+https://github.com/Dengda98/PyFMM.git # 库本身,重新拉取一遍
14+ . # 库本身
Original file line number Diff line number Diff line change @@ -22,11 +22,18 @@ def setup(app):
2222 app .add_css_file ('my_theme.css' )
2323
2424
25+ # 读取版本号
26+ def read_version ():
27+ version_file = os .path .join ('../../pyfmm' , '_version.py' )
28+ with open (version_file ) as f :
29+ exec (f .read ())
30+ return locals ()['__version__' ]
31+
2532project = 'PyFMM'
2633copyright = '2023, Zhu Dengda'
2734author = 'Zhu Dengda'
2835# 引入版本信息
29- version = setuptools_scm . get_version ( root = '../..' , relative_to = __file__ )
36+ version = read_version ( )
3037release = version
3138
3239# -- General configuration ---------------------------------------------------
Original file line number Diff line number Diff line change 1- # 占位文件
1+ __version__ = '0.2.1'
Original file line number Diff line number Diff line change 11
22[build-system ]
3- requires = [" setuptools>=42" , " wheel" , " setuptools-scm " ]
3+ requires = [" setuptools>=42" , " wheel" ]
44build-backend = " setuptools.build_meta"
5-
6- [tool .setuptools_scm ]
7- write_to = " pyfmm/_version.py"
8- fallback_version = " 0.2.1"
Original file line number Diff line number Diff line change 33from setuptools .command .develop import develop as develop_orig
44from setuptools .command .install import install as install_orig
55import subprocess
6- import sys
6+ import os , sys
7+
78
89class BuildExt (build_ext_orig ):
910 def run (self ):
@@ -29,10 +30,16 @@ def run(self):
2930 super ().run ()
3031
3132
33+ # 读取版本号
34+ def read_version ():
35+ version_file = os .path .join ('pyfmm' , '_version.py' )
36+ with open (version_file ) as f :
37+ exec (f .read ())
38+ return locals ()['__version__' ]
39+
3240setup (
3341 name = 'pyfmm' ,
34- use_scm_version = True , # 自动使用 Git 标签作为版本号
35- setup_requires = ['setuptools-scm' ],
42+ version = read_version (),
3643 description = 'A C/Python package for solving eikonal equation using Fast Marching Method' ,
3744 author = 'Zhu Dengda' ,
3845
You can’t perform that action at this time.
0 commit comments