Skip to content

Commit f98dc82

Browse files
committed
Dynamically get version component of build directory for building sphinx docs
This almost certainly isn't perfect, but it's a big step up and should work on (at least) any 32-bit or 64-bit version of python2 or python3 running on Linux (rather than just 64-bit python2.7 on Linux).
1 parent f5765b0 commit f98dc82

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

docs/conf.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
import sys, os, platform
15+
from string import digits
1516

1617
# If extensions (or modules to document with autodoc) are in another directory,
1718
# add these directories to sys.path here. If the directory is relative to the
1819
# documentation root, use os.path.abspath to make it absolute, like shown here.
19-
sys.path.insert(0, os.path.abspath('../build/lib.linux-x86_64-2.7'))
20+
version_string = sys.platform.rstrip(digits) + "-" + os.uname()[4] + "-" + ".".join(platform.python_version_tuple()[0:2])
21+
sys.path.insert(0, os.path.abspath('../build/lib.' + version_string))
2022

2123
# -- General configuration -----------------------------------------------------
2224

0 commit comments

Comments
 (0)