Skip to content
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

Update default sphinx version #4250

Merged
merged 4 commits into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def install_core_requirements(self):
self.project.get_feature_value(
Feature.USE_SPHINX_LATEST,
positive='sphinx<2',
negative='sphinx==1.7.4',
negative='sphinx<1.8',
),
'sphinx-rtd-theme<0.5',
'readthedocs-sphinx-ext<0.6'
Expand Down
48 changes: 28 additions & 20 deletions readthedocs/rtd_tests/tests/test_doc_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -1121,12 +1121,12 @@ def setUp(self):
self.build_env_mock = Mock()

self.base_requirements = [
'Pygments==2.2.0',
'setuptools<40',
'docutils==0.13.1',
'mock==1.0.1',
'pillow==2.6.1',
'alabaster>=0.7,<0.8,!=0.7.5',
'Pygments',
'setuptools',
'docutils',
'mock',
'pillow',
'alabaster',
]
self.base_conda_requirements = [
'mock',
Expand All @@ -1143,24 +1143,33 @@ def setUp(self):
mock.ANY, # cache path
]

def assertArgsStartsWith(self, args, function_mock):
"""
Assert that each element of args of the mock start
with each element of args.
"""
args_mock, _ = function_mock.call_args
for arg, arg_mock in zip(args, args_mock):
if arg is not mock.ANY:
self.assertTrue(arg_mock.startswith(arg))

def test_install_core_requirements_sphinx(self):
python_env = Virtualenv(
version=self.version_sphinx,
build_env=self.build_env_mock,
)
python_env.install_core_requirements()
requirements_sphinx = [
'commonmark==0.5.4',
'recommonmark==0.4.0',
'sphinx==1.7.4',
'sphinx-rtd-theme<0.5',
'readthedocs-sphinx-ext<0.6',
'commonmark',
'recommonmark',
'sphinx',
'sphinx-rtd-theme',
'readthedocs-sphinx-ext',
]
requirements = self.base_requirements + requirements_sphinx
args = self.pip_install_args + requirements
self.build_env_mock.run.assert_called_once_with(
*args, bin_path=mock.ANY
)
self.build_env_mock.run.assert_called_once()
self.assertArgsStartsWith(args, self.build_env_mock.run)

def test_install_core_requirements_mkdocs(self):
python_env = Virtualenv(
Expand All @@ -1169,15 +1178,14 @@ def test_install_core_requirements_mkdocs(self):
)
python_env.install_core_requirements()
requirements_mkdocs = [
'commonmark==0.5.4',
'recommonmark==0.4.0',
'mkdocs==0.17.3',
'commonmark',
'recommonmark',
'mkdocs',
]
requirements = self.base_requirements + requirements_mkdocs
args = self.pip_install_args + requirements
self.build_env_mock.run.assert_called_once_with(
*args, bin_path=mock.ANY
)
self.build_env_mock.run.assert_called_once()
self.assertArgsStartsWith(args, self.build_env_mock.run)

def test_install_user_requirements(self):
"""
Expand Down