Skip to content

Commit 43ba326

Browse files
committed
Only install sphinx packages when document type if sphinx
1 parent 1a6bcf6 commit 43ba326

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

readthedocs/doc_builder/python_environments.py

+17-16
Original file line numberDiff line numberDiff line change
@@ -115,20 +115,22 @@ def setup_base(self):
115115
def install_core_requirements(self):
116116
"""Install basic Read the Docs requirements into the virtualenv."""
117117
requirements = [
118-
'sphinx==1.5.3',
119118
'Pygments==2.2.0',
120119
'setuptools==28.8.0',
121120
'docutils==0.13.1',
122-
'mkdocs==0.15.0',
123121
'mock==1.0.1',
124122
'pillow==2.6.1',
125-
'readthedocs-sphinx-ext<0.6',
126-
'sphinx-rtd-theme<0.3',
127123
'alabaster>=0.7,<0.8,!=0.7.5',
128124
'commonmark==0.5.4',
129125
'recommonmark==0.4.0',
130126
]
131127

128+
if self.project.document_type == 'mkdocs':
129+
requirements.append('mkdocs==0.15.0')
130+
else:
131+
requirements.extend(['sphinx==1.5.3', 'sphinx-rtd-theme<0.3',
132+
'readthedocs-sphinx-ext<0.6'])
133+
132134
cmd = [
133135
'python',
134136
self.venv_bin(filename='pip'),
@@ -211,12 +213,21 @@ def install_core_requirements(self):
211213
"""Install basic Read the Docs requirements into the Conda env."""
212214
# Use conda for requirements it packages
213215
requirements = [
214-
'sphinx',
215216
'mock',
216217
'pillow',
217-
'sphinx_rtd_theme',
218218
]
219219

220+
# Install pip-only things.
221+
pip_requirements = [
222+
'recommonmark',
223+
]
224+
225+
if self.project.documentation_type == 'mkdocs':
226+
pip_requirements.append('mkdocs')
227+
else:
228+
pip_requirements.append('readthedocs-sphinx-ext')
229+
requirements.extend(['sphinx', 'sphinx-rtd-theme'])
230+
220231
cmd = [
221232
'conda',
222233
'install',
@@ -229,16 +240,6 @@ def install_core_requirements(self):
229240
*cmd
230241
)
231242

232-
# Install pip-only things.
233-
pip_requirements = [
234-
'mkdocs',
235-
'readthedocs-sphinx-ext',
236-
'recommonmark',
237-
]
238-
239-
if self.project.documentation_type == 'mkdocs':
240-
pip_requirements.append('mkdocs')
241-
242243
pip_cmd = [
243244
'python',
244245
self.venv_bin(filename='pip'),

0 commit comments

Comments
 (0)