Skip to content

Commit

Permalink
Deprecation: remove support for Sphinx 1.x (#10365)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
humitos authored Sep 26, 2023
1 parent 27d956a commit ac7d43a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 20 deletions.
16 changes: 2 additions & 14 deletions readthedocs/doc_builder/python_environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,27 +260,15 @@ 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",
negative="readthedocs-sphinx-ext<2.3",
),
]
)
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)
Expand Down
2 changes: 0 additions & 2 deletions readthedocs/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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"),
Expand Down
5 changes: 2 additions & 3 deletions readthedocs/projects/tests/test_build_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand Down
1 change: 0 additions & 1 deletion readthedocs/rtd_tests/tests/test_doc_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit ac7d43a

Please sign in to comment.