Skip to content

Commit 792312f

Browse files
committed
Add git-lfs support in RTD environment
Requires tweaking upstream RTD settings to install from pip. This logic was pulled from a discussion here: readthedocs/readthedocs.org#1846
1 parent 5ad62e8 commit 792312f

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ update-pip-requirements: ## Updates all Python requirements files via pip-compil
132132
securedrop/requirements/test-requirements.in
133133
pip-compile --output-file securedrop/requirements/securedrop-app-code-requirements.txt \
134134
securedrop/requirements/securedrop-app-code-requirements.in
135+
pip-compile --output-file securedrop/requirements/rtd-requirements.txt \
136+
securedrop/requirements/rtd-requirements.in
135137

136138
.PHONY: libvirt-share
137139
libvirt-share: ## Configure ACLs to allow RWX for libvirt VM (e.g. Admin Workstation)

docs/conf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@
1818
# https://docs.readthedocs.org/en/latest/faq.html#how-do-i-change-behavior-for-read-the-docs
1919
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
2020

21+
# Get SD root directory
22+
docs_dir = os.path.dirname(os.path.abspath(__file__))
23+
sd_root_dir = os.path.abspath(os.path.join(docs_dir,'../'))
24+
2125
# If extensions (or modules to document with autodoc) are in another directory,
2226
# add these directories to sys.path here. If the directory is relative to the
2327
# documentation root, use os.path.abspath to make it absolute, like shown here.
@@ -112,6 +116,10 @@
112116
# a list of builtin themes.
113117
if on_rtd:
114118
html_theme = 'default'
119+
120+
print('Fetching files with git_lfs')
121+
from git_lfs import fetch
122+
fetch(sd_root_dir)
115123
else:
116124
try:
117125
# If you want to build the docs locally using the RTD theme,
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
git-lfs
2+
sphinx
3+
sphinx-autobuild
4+
sphinx_rtd_theme
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#
2+
# This file is autogenerated by pip-compile
3+
# To update, run:
4+
#
5+
# pip-compile --output-file securedrop/requirements/rtd-requirements.txt securedrop/requirements/rtd-requirements.in
6+
#
7+
alabaster==0.7.11 # via sphinx
8+
argh==0.26.2 # via sphinx-autobuild, watchdog
9+
babel==2.6.0 # via sphinx
10+
certifi==2018.4.16 # via requests
11+
chardet==3.0.4 # via requests
12+
docutils==0.14 # via sphinx
13+
git-lfs==1.5
14+
idna==2.7 # via requests
15+
imagesize==1.0.0 # via sphinx
16+
jinja2==2.10 # via sphinx
17+
livereload==2.5.2 # via sphinx-autobuild
18+
markupsafe==1.0 # via jinja2
19+
packaging==17.1 # via sphinx
20+
pathtools==0.1.2 # via sphinx-autobuild, watchdog
21+
port-for==0.3.1 # via sphinx-autobuild
22+
pygments==2.2.0 # via sphinx
23+
pyparsing==2.2.0 # via packaging
24+
pytz==2018.4 # via babel
25+
pyyaml==3.12 # via sphinx-autobuild, watchdog
26+
requests==2.19.1 # via sphinx
27+
six==1.11.0 # via livereload, packaging, sphinx
28+
snowballstemmer==1.2.1 # via sphinx
29+
sphinx-autobuild==0.7.1
30+
sphinx-rtd-theme==0.4.0
31+
sphinx==1.7.5
32+
sphinxcontrib-websupport==1.1.0 # via sphinx
33+
tornado==5.0.2 # via livereload, sphinx-autobuild
34+
typing==3.6.4 # via sphinx
35+
urllib3==1.23 # via requests
36+
watchdog==0.8.3 # via sphinx-autobuild

0 commit comments

Comments
 (0)