Skip to content

Commit db6968c

Browse files
committed
Use stagpy.__version__ directly with Sphinx
1 parent b6f6839 commit db6968c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

docs/conf.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,15 @@
1212

1313
import sys
1414
import os
15+
from pathlib import Path
16+
from textwrap import dedent
17+
1518
sys.path.insert(0, os.path.abspath('..'))
1619

17-
from pkg_resources import get_distribution
20+
# do not try to create/read config files
21+
os.environ['STAGPY_ISOLATED'] = 'True'
22+
23+
import stagpy
1824

1925
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
2026
if on_rtd:
@@ -24,9 +30,6 @@
2430
html_theme = 'sphinx_rtd_theme'
2531
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
2632

27-
# do not try to create/read config files
28-
os.environ['STAGPY_ISOLATED'] = 'True'
29-
3033
# -- General configuration ------------------------------------------------
3134

3235
# If your documentation needs a minimal Sphinx version, state it here.
@@ -55,7 +58,7 @@
5558
author = 'Adrien Morison, Martina Ulvrova, Stéphane Labrosse'
5659

5760
# The full version, including alpha/beta/rc tags.
58-
release = get_distribution('stagpy').version
61+
release = stagpy.__version__
5962
# The short X.Y version.
6063
version = '.'.join(release.split('.')[:2])
6164

@@ -108,9 +111,6 @@
108111

109112
# -- Autogenerated configuration options list -----------------------------
110113

111-
from pathlib import Path
112-
from textwrap import dedent
113-
import stagpy
114114
dfile = Path('.') / 'sources' / 'config_opts.rst'
115115
with dfile.open('w') as fid:
116116
fid.write(dedent(

0 commit comments

Comments
 (0)