Skip to content

Commit ba1cbb1

Browse files
authored
Docs: Always use local theme (#1083)
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.
1 parent b356376 commit ba1cbb1

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

docs/conf.py

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,9 @@
44
import os
55
import re
66

7-
# If we are building locally, or the build on Read the Docs looks like a PR
8-
# build, prefer to use the version of the theme in this repo, not the installed
9-
# version of the theme.
10-
def is_development_build():
11-
# PR builds have an interger version
12-
re_version = re.compile(r'^[\d]+$')
13-
if 'READTHEDOCS' in os.environ:
14-
version = os.environ.get('READTHEDOCS_VERSION', '')
15-
if re_version.match(version):
16-
return True
17-
return False
18-
return True
19-
20-
if is_development_build():
21-
sys.path.insert(0, os.path.abspath('..'))
7+
# Prefer to use the version of the theme in this repo
8+
# and not the installed version of the theme.
9+
sys.path.insert(0, os.path.abspath('..'))
2210
sys.path.append(os.path.abspath('./demo/'))
2311

2412
import sphinx_rtd_theme

0 commit comments

Comments
 (0)