@@ -1243,6 +1243,44 @@ def test_install_core_requirements_sphinx(self, checkout_path):
1243
1243
args = self .pip_install_args + requirements
1244
1244
self .assertArgsStartsWith (args , calls [1 ])
1245
1245
1246
+ @mock .patch ('readthedocs.doc_builder.config.load_config' )
1247
+ @patch ('readthedocs.projects.models.Project.checkout_path' )
1248
+ def test_install_core_requirements_sphinx_system_packages_caps_setuptools (self , checkout_path , load_config ):
1249
+ config_data = {
1250
+ 'python' : {
1251
+ 'use_system_site_packages' : True ,
1252
+ },
1253
+ }
1254
+ load_config .side_effect = create_load (config_data )
1255
+ config = load_yaml_config (self .version_sphinx )
1256
+
1257
+ tmpdir = tempfile .mkdtemp ()
1258
+ checkout_path .return_value = tmpdir
1259
+ python_env = Virtualenv (
1260
+ version = self .version_sphinx ,
1261
+ build_env = self .build_env_mock ,
1262
+ config = config ,
1263
+ )
1264
+ python_env .install_core_requirements ()
1265
+ requirements_sphinx = [
1266
+ 'commonmark' ,
1267
+ 'recommonmark' ,
1268
+ 'sphinx' ,
1269
+ 'sphinx-rtd-theme' ,
1270
+ 'readthedocs-sphinx-ext' ,
1271
+ 'setuptools<58.3.0' ,
1272
+ ]
1273
+
1274
+ self .assertEqual (self .build_env_mock .run .call_count , 2 )
1275
+ calls = self .build_env_mock .run .call_args_list
1276
+
1277
+ core_args = self .pip_install_args + ['pip' , 'setuptools<58.3.0' ]
1278
+ self .assertArgsStartsWith (core_args , calls [0 ])
1279
+
1280
+ requirements = self .base_requirements + requirements_sphinx
1281
+ args = self .pip_install_args + ['-I' ] + requirements
1282
+ self .assertArgsStartsWith (args , calls [1 ])
1283
+
1246
1284
@patch ('readthedocs.projects.models.Project.checkout_path' )
1247
1285
def test_install_core_requirements_mkdocs (self , checkout_path ):
1248
1286
tmpdir = tempfile .mkdtemp ()
0 commit comments