Deactivate (provisorily) Python12-dev testing (#11035)

* fix flake8 warnings

* Deactivate (provisorily) testing with 3.12-dev

(refs:
https://github.com/sphinx-doc/sphinx/pull/10995#issuecomment-1330310586
)

* Escape # in tox.ini for tox 4 compatibility ('du-latest' tests)

Co-authored-by: Daniel Eades <danieleades@hotmail.com>
This commit is contained in:
Jean-François B 2022-12-16 12:41:54 +01:00 committed by GitHub
parent d8977d3e57
commit 7418d2ccc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 19 additions and 9 deletions

View File

@ -21,7 +21,6 @@ jobs:
- "3.9"
- "3.10"
- "3.11"
- "3.12-dev"
docutils:
- "du18"
- "du19"

9
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,9 @@
repos:
- repo: https://github.com/asottile/yesqa
rev: v1.4.0
hooks:
- id: yesqa
additional_dependencies:
- flake8-comprehensions
- flake8-bugbear
- flake8-simplify

View File

@ -153,8 +153,8 @@ def augment_descriptions_with_types(
force_rtype: bool
) -> None:
fields = cast(Iterable[nodes.field], node)
has_description = set() # type: Set[str]
has_type = set() # type: Set[str]
has_description: Set[str] = set()
has_type: Set[str] = set()
for field in fields:
field_name = field[0].astext()
parts = re.split(' +', field_name)

View File

@ -5,7 +5,7 @@ The todolist directive collects all todos of your project and lists them along
with a backlink to the original location.
"""
from typing import Any, Dict, List, Tuple, cast
from typing import Any, Dict, List, cast
from docutils import nodes
from docutils.nodes import Element, Node
@ -55,7 +55,7 @@ class Todo(BaseAdmonition, SphinxDirective):
if not self.options.get('class'):
self.options['class'] = ['admonition-todo']
(todo,) = super().run() # type: Tuple[Node]
(todo,) = super().run()
if isinstance(todo, nodes.system_message):
return [todo]
elif isinstance(todo, todo_node):

View File

@ -5,7 +5,8 @@ import unicodedata
from typing import TYPE_CHECKING, Any, Dict, Generator, List, Optional, Tuple, cast
from docutils import nodes
from docutils.nodes import Element, Node, Text
from docutils.nodes import Element # noqa: F401 (used for type comments only)
from docutils.nodes import Node, Text
from docutils.transforms import Transform, Transformer
from docutils.transforms.parts import ContentsFilter
from docutils.transforms.universal import SmartQuotes

View File

@ -3,7 +3,8 @@
from typing import Any, Dict, Iterable, cast
from docutils import nodes
from docutils.nodes import Element, TextElement
from docutils.nodes import TextElement # noqa: F401 (used for type comments only)
from docutils.nodes import Element
from docutils.writers.manpage import Translator as BaseTranslator
from docutils.writers.manpage import Writer

View File

@ -557,7 +557,7 @@ def test_too_many_requests_user_timeout(app, capsys):
class FakeResponse:
headers = {} # type: Dict[str, str]
headers: Dict[str, str] = {}
url = "http://localhost/"

View File

@ -23,7 +23,7 @@ description =
deps =
du18: docutils==0.18.*
du19: docutils==0.19.*
du-latest: git+https://repo.or.cz/docutils.git#subdirectory=docutils
du-latest: git+https://repo.or.cz/docutils.git\#subdirectory=docutils
extras =
test
setenv =