Skip to content

Commit af22d27

Browse files
authored
Merge pull request #4250 from stsewd/update-sphinx-version-1.7.5
Update default sphinx version
2 parents 5ea9c44 + f9afaf0 commit af22d27

File tree

2 files changed

+29
-21
lines changed

2 files changed

+29
-21
lines changed

readthedocs/doc_builder/python_environments.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def install_core_requirements(self):
243243
self.project.get_feature_value(
244244
Feature.USE_SPHINX_LATEST,
245245
positive='sphinx<2',
246-
negative='sphinx==1.7.4',
246+
negative='sphinx<1.8',
247247
),
248248
'sphinx-rtd-theme<0.5',
249249
'readthedocs-sphinx-ext<0.6'

readthedocs/rtd_tests/tests/test_doc_building.py

+28-20
Original file line numberDiff line numberDiff line change
@@ -1121,12 +1121,12 @@ def setUp(self):
11211121
self.build_env_mock = Mock()
11221122

11231123
self.base_requirements = [
1124-
'Pygments==2.2.0',
1125-
'setuptools<40',
1126-
'docutils==0.13.1',
1127-
'mock==1.0.1',
1128-
'pillow==2.6.1',
1129-
'alabaster>=0.7,<0.8,!=0.7.5',
1124+
'Pygments',
1125+
'setuptools',
1126+
'docutils',
1127+
'mock',
1128+
'pillow',
1129+
'alabaster',
11301130
]
11311131
self.base_conda_requirements = [
11321132
'mock',
@@ -1143,24 +1143,33 @@ def setUp(self):
11431143
mock.ANY, # cache path
11441144
]
11451145

1146+
def assertArgsStartsWith(self, args, function_mock):
1147+
"""
1148+
Assert that each element of args of the mock start
1149+
with each element of args.
1150+
"""
1151+
args_mock, _ = function_mock.call_args
1152+
for arg, arg_mock in zip(args, args_mock):
1153+
if arg is not mock.ANY:
1154+
self.assertTrue(arg_mock.startswith(arg))
1155+
11461156
def test_install_core_requirements_sphinx(self):
11471157
python_env = Virtualenv(
11481158
version=self.version_sphinx,
11491159
build_env=self.build_env_mock,
11501160
)
11511161
python_env.install_core_requirements()
11521162
requirements_sphinx = [
1153-
'commonmark==0.5.4',
1154-
'recommonmark==0.4.0',
1155-
'sphinx==1.7.4',
1156-
'sphinx-rtd-theme<0.5',
1157-
'readthedocs-sphinx-ext<0.6',
1163+
'commonmark',
1164+
'recommonmark',
1165+
'sphinx',
1166+
'sphinx-rtd-theme',
1167+
'readthedocs-sphinx-ext',
11581168
]
11591169
requirements = self.base_requirements + requirements_sphinx
11601170
args = self.pip_install_args + requirements
1161-
self.build_env_mock.run.assert_called_once_with(
1162-
*args, bin_path=mock.ANY
1163-
)
1171+
self.build_env_mock.run.assert_called_once()
1172+
self.assertArgsStartsWith(args, self.build_env_mock.run)
11641173

11651174
def test_install_core_requirements_mkdocs(self):
11661175
python_env = Virtualenv(
@@ -1169,15 +1178,14 @@ def test_install_core_requirements_mkdocs(self):
11691178
)
11701179
python_env.install_core_requirements()
11711180
requirements_mkdocs = [
1172-
'commonmark==0.5.4',
1173-
'recommonmark==0.4.0',
1174-
'mkdocs==0.17.3',
1181+
'commonmark',
1182+
'recommonmark',
1183+
'mkdocs',
11751184
]
11761185
requirements = self.base_requirements + requirements_mkdocs
11771186
args = self.pip_install_args + requirements
1178-
self.build_env_mock.run.assert_called_once_with(
1179-
*args, bin_path=mock.ANY
1180-
)
1187+
self.build_env_mock.run.assert_called_once()
1188+
self.assertArgsStartsWith(args, self.build_env_mock.run)
11811189

11821190
def test_install_user_requirements(self):
11831191
"""

0 commit comments

Comments
 (0)