Skip to content

Commit ae359f6

Browse files
committed
Dropped Python 3.8: remove unnecessary from __future__ import annotations statements
1 parent e2ea090 commit ae359f6

27 files changed

+9
-57
lines changed

doc/dev/contribute.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ Moreover, the following guidelines should be followed:
1919
should follow the `Google style <http://google-styleguide.googlecode.com/svn/trunk/pyguide.html?showone=Comments#Comments>`_.
2020

2121
* Add typing annotations for all functions and methods. The annotations should
22-
use the future syntax (``from __future__ import annotations``) and the
23-
``if TYPE_CHECKING`` pattern to avoid circular imports (see
22+
use the future syntax ``from __future__ import annotations`` (see
23+
`PEP 563 <https://www.python.org/dev/peps/pep-0563/>`_)
24+
and the ``if TYPE_CHECKING`` pattern to avoid circular imports (see
2425
`PEP 484 <https://www.python.org/dev/peps/pep-0484/>`_).
2526

2627
.. note::

guidata/configtools.py

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

37-
from __future__ import annotations
38-
3937
import gettext
4038
import os
4139
import os.path as osp

guidata/dataset/autodoc.py

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

6-
from __future__ import annotations
7-
86
import logging
97
import re
108
from inspect import Parameter, Signature

guidata/dataset/conv.py

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

25-
from __future__ import annotations
26-
2725
import inspect
2826
from typing import TYPE_CHECKING, Any
2927

guidata/dataset/note_directive.py

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

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

7-
from __future__ import annotations
8-
97
from typing import TYPE_CHECKING, Type
108

119
from docutils import nodes

guidata/dataset/qtitemwidgets.py

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

18-
from __future__ import annotations
19-
2018
import datetime
2119
import os
2220
import os.path as osp

guidata/env.py

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

10-
from __future__ import annotations
11-
1210
import argparse
1311
import enum
1412
import os

guidata/io/base.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,12 @@ 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 (
124-
sect == section
125-
), "Ending section does not match the current section: %s != %s" % (
126-
sect,
127-
section,
123+
assert sect == section, (
124+
"Ending section does not match the current section: %s != %s"
125+
% (
126+
sect,
127+
section,
128+
)
128129
)
129130

130131

guidata/io/h5fmt.py

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

10-
from __future__ import annotations
11-
1210
import datetime
1311
import sys
1412
from collections.abc import Callable, Sequence

guidata/io/inifmt.py

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

10-
from __future__ import annotations
11-
1210
from typing import Any
1311

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

0 commit comments

Comments
 (0)