Skip to content

Commit e03b2e2

Browse files
committed
Revert "chore: Remove all from __future__ import annotations"
This reverts commit 5d9b2c0.
1 parent 08eb94c commit e03b2e2

12 files changed

Lines changed: 15 additions & 3 deletions

File tree

src/sphinxnotes/render/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:license: BSD, see LICENSE for details.
77
"""
88

9+
from __future__ import annotations
910
from typing import TYPE_CHECKING
1011

1112
from . import meta
@@ -89,7 +90,6 @@ def extra_context(cls) -> ExtraContextRegistry:
8990

9091
REGISTRY = Registry()
9192

92-
9393
def setup(app: Sphinx):
9494
meta.pre_setup(app)
9595

src/sphinxnotes/render/ctx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
suitable for use with Jinja templates.
44
"""
55

6+
from __future__ import annotations
67
from typing import Any
78
from abc import ABC, abstractmethod
89
from collections.abc import Hashable

src/sphinxnotes/render/ctxnodes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import annotations
12
from typing import TYPE_CHECKING, override
23
from pprint import pformat
34

@@ -22,6 +23,7 @@
2223
if TYPE_CHECKING:
2324
from typing import Any, Callable, ClassVar
2425
from .markup import Host
26+
from .ctx import ResolvedContext
2527

2628

2729
class pending_node(nodes.Element):

src/sphinxnotes/render/data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:license: BSD, see LICENSE for details.
99
"""
1010

11+
from __future__ import annotations
1112
from typing import TYPE_CHECKING, Literal
1213
import re
1314
from dataclasses import dataclass, asdict, field as dataclass_field

src/sphinxnotes/render/extractx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import annotations
12
from typing import TYPE_CHECKING, override
23
from abc import ABC, abstractmethod
34

src/sphinxnotes/render/markup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
:license: BSD, see LICENSE for details.
99
"""
1010

11+
from __future__ import annotations
1112
from dataclasses import dataclass
1213
from typing import TYPE_CHECKING
1314

src/sphinxnotes/render/meta.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Project meta infos.
66
################################################################################
77

8+
from __future__ import annotations
89
from importlib import metadata
910

1011
__project__ = 'sphinxnotes-render'

src/sphinxnotes/render/pipeline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""This module defines pipeline for rendering data to nodes."""
22

3+
from __future__ import annotations
34
from typing import TYPE_CHECKING, override, final, cast
45
from abc import abstractmethod, ABC
56

src/sphinxnotes/render/render.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import annotations
12
from dataclasses import dataclass
23
from enum import Enum
34

@@ -21,7 +22,7 @@ class Phase(Enum):
2122
Resolving = 'resolving'
2223

2324
@classmethod
24-
def default(cls) -> 'Phase':
25+
def default(cls) -> Phase:
2526
return cls.Parsing
2627

2728

src/sphinxnotes/render/sources.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
This module provides helpful BaseContextSource subclasses.
99
"""
1010

11+
from __future__ import annotations
1112
from typing import override
1213
from abc import abstractmethod
1314
from dataclasses import dataclass
@@ -99,7 +100,7 @@ def current_schema(self) -> Schema:
99100
@classmethod
100101
def derive(
101102
cls, name: str, schema: Schema, tmpl: Template
102-
) -> type['StrictDataDefineDirective']:
103+
) -> type[StrictDataDefineDirective]:
103104
"""Dynamically derive a new directive class from schema and template.
104105
105106
This method generates a new ``StrictDataDefineDirective`` subclass with

0 commit comments

Comments
 (0)