Skip to content

Commit

Permalink
docs/conf: better handle PYTHONPATH expectations
Browse files Browse the repository at this point in the history
* the Buildbot specific modules are relative to `conf.py`, not current
  directory
* we should be able to build the docs *even* if Buildbot is not
  installed
  • Loading branch information
Mikhail Sobolev committed Jul 15, 2016
1 parent a624266 commit 49f1a9a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions master/docs/conf.py
Expand Up @@ -19,13 +19,17 @@

import pkg_resources

from buildbot.util.raml import RamlSpec

# 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.
here = os.path.abspath('.')
sys.path.append(here)
sys.path.insert(1, os.path.dirname(os.path.abspath(__file__)))

try:
from buildbot.util.raml import RamlSpec
except ImportError:
sys.path.insert(2, os.path.join(os.path.dirname(os.path.abspath(__file__)),
os.pardir))
from buildbot.util.raml import RamlSpec

# -- General configuration -----------------------------------------------
try:
Expand Down

0 comments on commit 49f1a9a

Please sign in to comment.