From 8be92483c90af0b528ea8bd6ddaf318095edd9d4 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 30 May 2023 15:17:01 +0200 Subject: [PATCH] Deprecation: remove support for Sphinx 1.x We are installing Sphinx 1.x based on a feature flag. There are around 900 projects still using 1.x, based on https://ethicalads.metabaseapp.com/question/250-projects-using-sphinx-timeserie Note this feature flag is enabled by default for new projects starting on Oct. 20, 2020 We may need to send them an email about this and informing them how to create a `requirements.txt` file to pin their dependencies. I don't think that the migration to a config file v2 would enforce them to pin Sphinx. Related #10342 --- readthedocs/doc_builder/python_environments.py | 16 ++-------------- readthedocs/projects/models.py | 2 -- readthedocs/projects/tests/test_build_tasks.py | 5 ++--- readthedocs/rtd_tests/tests/test_doc_building.py | 2 -- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index 77cae1705ed..e4ff17f231a 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -219,18 +219,8 @@ def install_core_requirements(self): else: requirements.extend( [ - self.project.get_feature_value( - Feature.USE_SPHINX_LATEST, - positive="sphinx", - negative="sphinx<2", - ), - # If defaulting to Sphinx 2+, we need to push the latest theme - # release as well. `<0.5.0` is not compatible with Sphinx 2+ - self.project.get_feature_value( - Feature.USE_SPHINX_LATEST, - positive="sphinx-rtd-theme", - negative="sphinx-rtd-theme<0.5", - ), + "sphinx", + "sphinx-rtd-theme", self.project.get_feature_value( Feature.USE_SPHINX_RTD_EXT_LATEST, positive="readthedocs-sphinx-ext", @@ -238,8 +228,6 @@ def install_core_requirements(self): ), ] ) - if not self.project.has_feature(Feature.USE_SPHINX_LATEST): - requirements.extend(["jinja2<3.1.0"]) cmd = copy.copy(pip_install_cmd) if self.config.python.use_system_site_packages: diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index afc8f7e0fc5..3c083c998b4 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1895,7 +1895,6 @@ def add_features(sender, **kwargs): PIP_ALWAYS_UPGRADE = 'pip_always_upgrade' USE_NEW_PIP_RESOLVER = 'use_new_pip_resolver' DONT_INSTALL_LATEST_PIP = 'dont_install_latest_pip' - USE_SPHINX_LATEST = 'use_sphinx_latest' DEFAULT_TO_MKDOCS_0_17_3 = 'default_to_mkdocs_0_17_3' USE_MKDOCS_LATEST = 'use_mkdocs_latest' USE_SPHINX_RTD_EXT_LATEST = 'rtd_sphinx_ext_latest' @@ -2034,7 +2033,6 @@ def add_features(sender, **kwargs): DONT_INSTALL_LATEST_PIP, _("Build: Don't install the latest version of pip"), ), - (USE_SPHINX_LATEST, _("Sphinx: Use latest version of Sphinx")), ( DEFAULT_TO_MKDOCS_0_17_3, _("MkDOcs: Install mkdocs 0.17.3 by default"), diff --git a/readthedocs/projects/tests/test_build_tasks.py b/readthedocs/projects/tests/test_build_tasks.py index 3646d3f8652..5dbb64e3d0b 100644 --- a/readthedocs/projects/tests/test_build_tasks.py +++ b/readthedocs/projects/tests/test_build_tasks.py @@ -726,10 +726,9 @@ def test_build_commands_executed( "alabaster>=0.7,<0.8,!=0.7.5", "commonmark==0.9.1", "recommonmark==0.5.0", - "sphinx<2", - "sphinx-rtd-theme<0.5", + "sphinx", + "sphinx-rtd-theme", "readthedocs-sphinx-ext<2.3", - "jinja2<3.1.0", bin_path=mock.ANY, cwd=mock.ANY, ), diff --git a/readthedocs/rtd_tests/tests/test_doc_building.py b/readthedocs/rtd_tests/tests/test_doc_building.py index adb57db0495..e3c1f538537 100644 --- a/readthedocs/rtd_tests/tests/test_doc_building.py +++ b/readthedocs/rtd_tests/tests/test_doc_building.py @@ -412,7 +412,6 @@ def test_install_core_requirements_sphinx(self, checkout_path): "sphinx", "sphinx-rtd-theme", "readthedocs-sphinx-ext", - "jinja2<3.1.0", ] self.assertEqual(self.build_env_mock.run.call_count, 2) @@ -450,7 +449,6 @@ def test_install_core_requirements_sphinx_system_packages_caps_setuptools(self, "sphinx", "sphinx-rtd-theme", "readthedocs-sphinx-ext", - "jinja2<3.1.0", "setuptools", ]