8000 add __version__ global, and use this for the sphinx doco · astyl/spatialmath-python@e5e909b · GitHub
[go: up one dir, main page]

Skip to content

Commit e5e909b

Browse files
committed
add __version__ global, and use this for the sphinx doco
1 parent 1f4e6a1 commit e5e909b

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

docs/source/conf.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = 'Spatial Maths package'
23-
copyright = '2022, Peter Corke'
23+
copyright = '2020-, Peter Corke.'
2424
author = 'Peter Corke'
25-
version = '0.12'
25+
import spatialmath
26+
version = spatialmath.__version__
2627

27-
print(__file__)
2828
# The full version, including alpha/beta/rc tags
29-
with open('../../RELEASE', encoding='utf-8') as f:
30-
release = f.read()
29+
# with open('../../RELEASE', encoding='utf-8') as f:
30+
# release = f.read()
31+
# import spatialmath
32+
# release = spatialmath.__version__
3133

3234
# -- General configuration ---------------------------------------------------
3335

spatialmath/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,10 @@
3737
"smb",
3838
]
3939

40+
try:
41+
import importlib.metadata
42+
__version__ = importlib.metadata.version("spatialmath-python")
43+
except:
44+
pass
45+
4046

0 commit comments

Comments
 (0)
0