File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 5
5
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6
6
7
7
import os
8
+ import numpy_financial
8
9
9
10
# -- Path setup --------------------------------------------------------------
10
11
43
44
# This pattern also affects html_static_path and html_extra_path.
44
45
exclude_patterns = []
45
46
46
- version = '0.0.1.dev0'
47
+ version = numpy_financial . __version__
47
48
48
49
# -- Options for HTML output -------------------------------------------------
49
50
Original file line number Diff line number Diff line change 1
1
2
2
3
+ __version__ = "0.0.1.dev3"
4
+
3
5
from ._financial import *
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
3
3
4
+ def get_version ():
5
+ """
6
+ Find the value assigned to __version__ in numpy_financial/__init__.py.
7
+
8
+ This function assumes that there is a line of the form
9
+
10
+ __version__ = "version-string"
11
+
12
+ in that file. It returns the string version-string, or None if such a
13
+ line is not found.
14
+ """
15
+ with open ("numpy_financial/__init__.py" , "r" ) as f :
16
+ for line in f :
17
+ s = [w .strip () for w in line .split ("=" , 1 )]
18
+ if len (s ) == 2 and s [0 ] == "__version__" :
19
+ return s [1 ][1 :- 1 ]
20
+
21
+
4
22
def configuration (parent_package = '' , top_path = None ):
5
23
from numpy .distutils .misc_util import Configuration
6
24
config = Configuration (None , parent_package , top_path )
@@ -12,5 +30,5 @@ def configuration(parent_package='', top_path=None):
12
30
from numpy .distutils .core import setup
13
31
14
32
setup (name = 'numpy-financial' ,
15
- version = '0.0.1.dev2' ,
33
+ version = get_version () ,
16
34
configuration = configuration )
You can’t perform that action at this time.
0 commit comments