Default to sphinx theme 0.5.0 when defaulting to latest sphinx
The default of sphinx theme `<0.5.0` is not compatible with Sphinx 2+,
it results in a large number of display issues if you don't set the
html4 writer as the default.
@@ -380,7 +380,13 @@ class Virtualenv(PythonEnvironment):
positive='sphinx',
negative='sphinx<2',
),
- 'sphinx-rtd-theme<0.5',
+ # 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',
+ ),
self.project.get_feature_value(
Feature.USE_SPHINX_RTD_EXT_LATEST,
positive='readthedocs-sphinx-ext',
