Skip to content

Commit f918424

Browse files
committed
Nox: Sphinx > 5.3 breaks docutils < 0.18
1 parent 39831ac commit f918424

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

noxfile.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ def regression_sphinx_py39(session, sphinx):
115115
def _install(session, docutils=None, sphinx=None, dist='wheel',
116116
dependencies=[]):
117117
session.poetry.installroot(distribution_format=dist)
118-
if dependencies:
119-
session.install(*(d for d in dependencies
120-
if not (sphinx and d.lower() == 'sphinx')))
121118
deps = []
122119
if docutils:
123120
deps.append(f"docutils=={docutils}")
121+
major, minor, *_ = docutils.split('.')
122+
if (int(major), int(minor)) < (0, 18):
123+
assert sphinx is None
124+
sphinx = '5.3.0'
124125
if sphinx:
125126
deps.append(f"sphinx=={sphinx}")
126127
major, _ = sphinx.split('.', maxsplit=1)
@@ -137,6 +138,9 @@ def _install(session, docutils=None, sphinx=None, dist='wheel',
137138
deps.append("sphinxcontrib-htmlhelp==2.0.1")
138139
deps.append("sphinxcontrib-serializinghtml==1.1.5")
139140
deps.append("sphinxcontrib-qthelp==1.0.3")
141+
if dependencies:
142+
session.install(*(d for d in dependencies
143+
if not (sphinx and d.lower() == 'sphinx')))
140144
if deps:
141145
session.run("pip", "install", *deps)
142146

0 commit comments

Comments
 (0)