Skip to content

Commit 88a2c48

Browse files
committed
Use the managed version number also in the documentation.
1 parent 8f54062 commit 88a2c48

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test: build
1111
sdist:
1212
$(PYTHON) setup.py sdist
1313

14-
doc-html:
14+
doc-html: .version
1515
$(MAKE) -C doc html
1616

1717
clean:
@@ -28,5 +28,7 @@ distclean: clean
2828
rm -rf pytest_dependency.egg-info
2929
$(MAKE) -C doc distclean
3030

31+
.version:
32+
$(PYTHON) setup.py check
3133

3234
.PHONY: build test sdist doc-html clean distclean

doc/src/conf.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
import sys, os
1313
import os.path
1414

15-
# Add the top source directory to the module path. This file is
16-
# exec'ed with its directory as cwd. This is "doc/src" relativ to the
17-
# top source directory. So we need to go 2 dirs up.
18-
sys.path.insert(0,os.path.dirname(os.path.dirname(os.getcwd())))
15+
# The top source directory. This file is exec'ed with its directory
16+
# as cwd. This is "doc/src" relativ to the top source directory. So
17+
# we need to go 2 dirs up.
18+
topdir = os.path.dirname(os.path.dirname(os.getcwd()))
1919

2020
# If extensions (or modules to document with autodoc) are in another directory,
2121
# add these directories to sys.path here. If the directory is relative to the
@@ -50,11 +50,9 @@
5050
# The version info for the project you're documenting, acts as replacement for
5151
# |version| and |release|, also used in various other places throughout the
5252
# built documents.
53-
#
54-
# The short X.Y version.
55-
version = '0.4'
56-
# The full version, including alpha/beta/rc tags.
57-
release = '0.4.0'
53+
with open(os.path.join(topdir, ".version"), "rt") as f:
54+
release = f.read()
55+
version = ".".join(release.split(".")[0:2])
5856

5957
# The language for content autogenerated by Sphinx. Refer to documentation
6058
# for a list of supported languages.

0 commit comments

Comments
 (0)