Skip to content

Commit 4dae9dd

Browse files
committed
Revert "Dropped Python 3.8: remove unnecessary from __future__ import annotations statements"
This reverts commit ae359f6.
1 parent ae359f6 commit 4dae9dd

26 files changed

+55
-6
lines changed

guidata/configtools.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
.. autofunction:: add_image_module_path
3535
"""
3636

37+
from __future__ import annotations
38+
3739
import gettext
3840
import os
3941
import os.path as osp

guidata/dataset/autodoc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
classes.
44
"""
55

6+
from __future__ import annotations
7+
68
import logging
79
import re
810
from inspect import Parameter, Signature

guidata/dataset/conv.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
.. autofunction:: guidata.dataset.create_dataset_from_dict
2323
"""
2424

25+
from __future__ import annotations
26+
2527
import inspect
2628
from typing import TYPE_CHECKING, Any
2729

guidata/dataset/note_directive.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
"""Sphinx directive to display a note about how to instanciate a dataset class"""
66

7+
from __future__ import annotations
8+
79
from typing import TYPE_CHECKING, Type
810

911
from docutils import nodes

guidata/dataset/qtitemwidgets.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
Example: ChoiceWidget <--> ChoiceItem, ImageChoiceItem
1616
"""
1717

18+
from __future__ import annotations
19+
1820
import datetime
1921
import os
2022
import os.path as osp

guidata/env.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
Execution environmnent utilities
88
"""
99

10+
from __future__ import annotations
11+
1012
import argparse
1113
import enum
1214
import os

guidata/io/base.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,11 @@ def end(self, section: str) -> None:
120120
section (str): The name of the section to end.
121121
"""
122122
sect = self.option.pop(-1)
123-
assert sect == section, (
124-
"Ending section does not match the current section: %s != %s"
125-
% (
126-
sect,
127-
section,
128-
)
123+
assert (
124+
sect == section
125+
), "Ending section does not match the current section: %s != %s" % (
126+
sect,
127+
section,
129128
)
130129

131130

guidata/io/h5fmt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
HDF5 files (.h5)
88
"""
99

10+
from __future__ import annotations
11+
1012
import datetime
1113
import sys
1214
from collections.abc import Callable, Sequence

guidata/io/inifmt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
Configuration files (.ini)
88
"""
99

10+
from __future__ import annotations
11+
1012
from typing import Any
1113

1214
from guidata.io.base import BaseIOHandler, GroupContext, WriterMixin

guidata/io/jsonfmt.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
# pylint: disable=invalid-name # Allows short reference names like x, y, ...
1414

15+
from __future__ import annotations
16+
1517
import json
1618
import os
1719
from collections.abc import Callable, Sequence

0 commit comments

Comments
 (0)