[Python-modules-commits] [python-attrs] 08/15: Add build directory to sys.path for autodoc.

Tristan Seligmann mithrandi at moszumanska.debian.org
Fri Jun 30 02:27:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

mithrandi pushed a commit to branch master
in repository python-attrs.

commit 3b8aee49df1c6d64ed95e45b20fc463cc2af8be2
Author: Tristan Seligmann <mithrandi at mithrandi.net>
Date:   Mon Oct 10 04:42:22 2016 +0200

    Add build directory to sys.path for autodoc.
---
 docs/conf.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/docs/conf.py b/docs/conf.py
index 52a04e7..e08b9ed 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -27,6 +27,13 @@ def find_version(*file_paths):
         return version_match.group(1)
     raise RuntimeError("Unable to find version string.")
 
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+import sys
+ver = sys.version_info[0:2]
+sys.path.insert(
+    0, os.path.abspath('../.pybuild/pythonX.Y_{0}.{1}/build'.format(*ver)))
 
 # -- General configuration ------------------------------------------------
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-attrs.git



More information about the Python-modules-commits mailing list