|
8 | 8 | import nox_poetry |
9 | 9 |
|
10 | 10 | sys.path.append('.') |
| 11 | + |
| 12 | +from packaging.version import Version |
| 13 | + |
11 | 14 | from noxutil import get_versions, version_to_tuple |
12 | 15 |
|
13 | 16 |
|
@@ -110,25 +113,25 @@ def _install(session, docutils=None, sphinx=None, dist='wheel', extras=[], |
110 | 113 | if docutils: |
111 | 114 | deps.append(f"docutils=={docutils}") |
112 | 115 | docutils_version = version_to_tuple(docutils) |
113 | | - if docutils_version < (0, 20): |
| 116 | + if docutils_version < Version('0.20'): |
114 | 117 | assert sphinx is None |
115 | 118 | sphinx = '5.3.0' |
116 | 119 | if sphinx: |
117 | 120 | deps.append(f"sphinx=={sphinx}") |
118 | 121 | sphinx_version = version_to_tuple(sphinx) |
119 | | - if sphinx_version < (4, ): |
| 122 | + if sphinx_version < Version('4'): |
120 | 123 | # https://github.com/sphinx-doc/sphinx/issues/10291 |
121 | 124 | deps.append("jinja2<3.1") |
122 | | - elif sphinx_version < (6, ): |
| 125 | + elif sphinx_version < Version('6'): |
123 | 126 | deps.append("myst-parser==0.18.1") |
124 | | - if sphinx_version <= (6, 2): |
| 127 | + if sphinx_version <= Version('6.2'): |
125 | 128 | try: |
126 | 129 | python_version = tuple(int(v) for v in session.python.split('.')) |
127 | 130 | except AttributeError: |
128 | 131 | python_version = sys.version_info[:3] |
129 | 132 | if python_version >= (3, 13): |
130 | 133 | deps.append("standard-imghdr==3.13.0") |
131 | | - if sphinx_version < (5, ): |
| 134 | + if sphinx_version < Version('5'): |
132 | 135 | # https://github.com/sphinx-doc/sphinx/issues/11890 |
133 | 136 | deps.append("alabaster==0.7.13") |
134 | 137 | deps.append("sphinxcontrib-applehelp==1.0.4") |
|
0 commit comments