mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 19:43:23 +08:00
Utilities/Sphinx: Restore explicit check for Sphinx 2.x or later
Refactoring in commitadbc8c982d
(Utilities/Sphinx: Fix flake8 gripes in cmake.py, 2023-03-13, v3.27.0-rc1~317^2) moved the assertion added by commitcef51925a4
(Utilities/Sphinx: Require Sphinx 2.x or later, 2023-03-13, v3.27.0-rc1~317^2~2) to after imports, which is too late to clearly reject older Sphinx versions.
This commit is contained in:
3
Utilities/Sphinx/.flake8
Normal file
3
Utilities/Sphinx/.flake8
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[flake8]
|
||||||
|
per-file-ignores =
|
||||||
|
cmake.py: E402
|
@@ -11,6 +11,11 @@ from typing import Any, List, Tuple, Type, cast
|
|||||||
|
|
||||||
import sphinx
|
import sphinx
|
||||||
|
|
||||||
|
# Require at least Sphinx 2.x.
|
||||||
|
# flake8 issues E402 for imports after this, but the purpose of this
|
||||||
|
# check is to fail more clearly if the imports below will fail.
|
||||||
|
assert sphinx.version_info >= (2,)
|
||||||
|
|
||||||
from docutils.utils.code_analyzer import Lexer, LexerError
|
from docutils.utils.code_analyzer import Lexer, LexerError
|
||||||
from docutils.parsers.rst import Directive, directives
|
from docutils.parsers.rst import Directive, directives
|
||||||
from docutils.transforms import Transform
|
from docutils.transforms import Transform
|
||||||
@@ -110,9 +115,6 @@ CMakeLexer.tokens["root"] = [
|
|||||||
|
|
||||||
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
# Require at least Sphinx 2.x.
|
|
||||||
assert sphinx.version_info >= (2,)
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
# RE to split multiple command signatures.
|
# RE to split multiple command signatures.
|
||||||
|
Reference in New Issue
Block a user