From ac7d43a622d7103f3a6f3b3540c4114ac1da2acc Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 26 Sep 2023 22:56:43 +0200 Subject: [PATCH] Deprecation: remove support for Sphinx 1.x (#10365) 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 | 1 - 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/readthedocs/doc_builder/python_environments.py b/readthedocs/doc_builder/python_environments.py index 114c9c155e9..da33474c37f 100644 --- a/readthedocs/doc_builder/python_environments.py +++ b/readthedocs/doc_builder/python_environments.py @@ -260,18 +260,8 @@ def _install_old_requirements(self, pip_install_cmd): 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", @@ -279,8 +269,6 @@ def _install_old_requirements(self, pip_install_cmd): ), ] ) - if not self.project.has_feature(Feature.USE_SPHINX_LATEST): - requirements.extend(["jinja2<3.1.0"]) cmd = copy.copy(pip_install_cmd) cmd.extend(requirements) diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 0e9817d59e2..2161be67ce4 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1891,7 +1891,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' USE_SPHINX_RTD_EXT_LATEST = 'rtd_sphinx_ext_latest' INSTALL_LATEST_CORE_REQUIREMENTS = "install_latest_core_requirements" @@ -1997,7 +1996,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")), ( USE_SPHINX_RTD_EXT_LATEST, _("Sphinx: Use latest version of the Read the Docs Sphinx extension"), diff --git a/readthedocs/projects/tests/test_build_tasks.py b/readthedocs/projects/tests/test_build_tasks.py index a1519bb707b..a52f3b0e5e7 100644 --- a/readthedocs/projects/tests/test_build_tasks.py +++ b/readthedocs/projects/tests/test_build_tasks.py @@ -775,10 +775,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 9ba09a54b02..92c21b3b81f 100644 --- a/readthedocs/rtd_tests/tests/test_doc_building.py +++ b/readthedocs/rtd_tests/tests/test_doc_building.py @@ -437,7 +437,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)