Skip to content

Install either mkdocs or sphinx depending on document type #2979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,22 @@ def setup_base(self):
def install_core_requirements(self):
"""Install basic Read the Docs requirements into the virtualenv."""
requirements = [
'sphinx==1.5.3',
'Pygments==2.2.0',
'setuptools==28.8.0',
'docutils==0.13.1',
'mkdocs==0.15.0',
'mock==1.0.1',
'pillow==2.6.1',
'readthedocs-sphinx-ext<0.6',
'sphinx-rtd-theme<0.3',
'alabaster>=0.7,<0.8,!=0.7.5',
'commonmark==0.5.4',
'recommonmark==0.4.0',
]

if self.project.document_type == 'mkdocs':
requirements.append('mkdocs==0.15.0')
else:
requirements.extend(['sphinx==1.5.3', 'sphinx-rtd-theme<0.3',
'readthedocs-sphinx-ext<0.6'])

cmd = [
'python',
self.venv_bin(filename='pip'),
Expand Down Expand Up @@ -211,12 +213,21 @@ def install_core_requirements(self):
"""Install basic Read the Docs requirements into the Conda env."""
# Use conda for requirements it packages
requirements = [
'sphinx',
'mock',
'pillow',
'sphinx_rtd_theme',
]

# Install pip-only things.
pip_requirements = [
'recommonmark',
]

if self.project.documentation_type == 'mkdocs':
pip_requirements.append('mkdocs')
else:
pip_requirements.append('readthedocs-sphinx-ext')
requirements.extend(['sphinx', 'sphinx-rtd-theme'])

cmd = [
'conda',
'install',
Expand All @@ -229,13 +240,6 @@ def install_core_requirements(self):
*cmd
)

# Install pip-only things.
pip_requirements = [
'mkdocs',
'readthedocs-sphinx-ext',
'recommonmark',
]

pip_cmd = [
'python',
self.venv_bin(filename='pip'),
Expand Down