Skip to content

Commit

Permalink
Docs: Always use local theme (#1083)
Browse files Browse the repository at this point in the history
This changes non PR builds on rtd to use the local theme and not the old 0.4.3 theme. We want our docs to show what the theme looks like based on the current release, not an old version.
  • Loading branch information
Blendify committed Mar 12, 2021
1 parent b356376 commit ba1cbb1
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions docs/conf.py
Expand Up @@ -4,21 +4,9 @@
import os
import re

# If we are building locally, or the build on Read the Docs looks like a PR
# build, prefer to use the version of the theme in this repo, not the installed
# version of the theme.
def is_development_build():
# PR builds have an interger version
re_version = re.compile(r'^[\d]+$')
if 'READTHEDOCS' in os.environ:
version = os.environ.get('READTHEDOCS_VERSION', '')
if re_version.match(version):
return True
return False
return True

if is_development_build():
sys.path.insert(0, os.path.abspath('..'))
# Prefer to use the version of the theme in this repo
# and not the installed version of the theme.
sys.path.insert(0, os.path.abspath('..'))
sys.path.append(os.path.abspath('./demo/'))

import sphinx_rtd_theme
Expand Down

0 comments on commit ba1cbb1

Please sign in to comment.