From 1dd191003b191e7f9253d68acac9c03f31006abc Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Fri, 15 Jun 2018 13:20:04 -0500 Subject: [PATCH 1/4] Update default sphinx version --- readthedocs/doc_builder/python_environments.py | 2 +- readthedocs/rtd_tests/tests/test_doc_building.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index 96190a47919..379006766cc 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -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.7.5', ), 'sphinx-rtd-theme<0.5', 'readthedocs-sphinx-ext<0.6' diff --git a/readthedocs/rtd_tests/tests/test_doc_building.py b/readthedocs/rtd_tests/tests/test_doc_building.py index 27664688262..d926cd150f3 100644 --- a/readthedocs/rtd_tests/tests/test_doc_building.py +++ b/readthedocs/rtd_tests/tests/test_doc_building.py @@ -1152,7 +1152,7 @@ def test_install_core_requirements_sphinx(self): requirements_sphinx = [ 'commonmark==0.5.4', 'recommonmark==0.4.0', - 'sphinx==1.7.4', + 'sphinx==1.7.5', 'sphinx-rtd-theme<0.5', 'readthedocs-sphinx-ext<0.6', ] From 5fd8abc955f2f10370f84252fc5d73fe34033084 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 18 Jun 2018 10:19:18 -0500 Subject: [PATCH 2/4] Pin sphinx to <1.8 --- readthedocs/doc_builder/python_environments.py | 2 +- readthedocs/rtd_tests/tests/test_doc_building.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index 379006766cc..3d2aa1aba5a 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -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.5', + negative='sphinx<1.8', ), 'sphinx-rtd-theme<0.5', 'readthedocs-sphinx-ext<0.6' diff --git a/readthedocs/rtd_tests/tests/test_doc_building.py b/readthedocs/rtd_tests/tests/test_doc_building.py index d926cd150f3..5c9085fef9c 100644 --- a/readthedocs/rtd_tests/tests/test_doc_building.py +++ b/readthedocs/rtd_tests/tests/test_doc_building.py @@ -1152,7 +1152,7 @@ def test_install_core_requirements_sphinx(self): requirements_sphinx = [ 'commonmark==0.5.4', 'recommonmark==0.4.0', - 'sphinx==1.7.5', + 'sphinx<1.8', 'sphinx-rtd-theme<0.5', 'readthedocs-sphinx-ext<0.6', ] From 92513d5aec93561e5150542257ea05c2f2ec83de Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 18 Jun 2018 12:36:55 -0500 Subject: [PATCH 3/4] Refactor tests --- .../rtd_tests/tests/test_doc_building.py | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_doc_building.py b/readthedocs/rtd_tests/tests/test_doc_building.py index 5c9085fef9c..e70c3f6a718 100644 --- a/readthedocs/rtd_tests/tests/test_doc_building.py +++ b/readthedocs/rtd_tests/tests/test_doc_building.py @@ -1143,6 +1143,16 @@ 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, @@ -1158,9 +1168,8 @@ def test_install_core_requirements_sphinx(self): ] 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( @@ -1175,9 +1184,8 @@ def test_install_core_requirements_mkdocs(self): ] 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): """ From f9afaf0af72c1b133e6b862743a4566b5e311953 Mon Sep 17 00:00:00 2001 From: Santos Gallegos Date: Mon, 18 Jun 2018 12:40:23 -0500 Subject: [PATCH 4/4] Unpin requirements in tests --- .../rtd_tests/tests/test_doc_building.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/readthedocs/rtd_tests/tests/test_doc_building.py b/readthedocs/rtd_tests/tests/test_doc_building.py index e70c3f6a718..512de4f7d5a 100644 --- a/readthedocs/rtd_tests/tests/test_doc_building.py +++ b/readthedocs/rtd_tests/tests/test_doc_building.py @@ -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', @@ -1160,11 +1160,11 @@ def test_install_core_requirements_sphinx(self): ) python_env.install_core_requirements() requirements_sphinx = [ - 'commonmark==0.5.4', - 'recommonmark==0.4.0', - 'sphinx<1.8', - '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 @@ -1178,9 +1178,9 @@ 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