Skip to content

Commit

Permalink
Merge pull request #20 from Safe/FMEENGINE-79058
Browse files Browse the repository at this point in the history
Avoid TypeErrors caused by annotations under Python 3.8 and older
  • Loading branch information
carsonyl authored and GitHub Enterprise committed Jul 19, 2023
2 parents c095671 + c523724 commit 9e7e54e
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# fmetools changes

## 0.7.1

* Fix type annotations when using Python 3.8 and earlier.

## 0.7.0

* Add HTML docs and expanded existing docstrings.
Expand Down
2 changes: 1 addition & 1 deletion src/fmetools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# coding: utf-8

__version__ = "0.7.0"
__version__ = "0.7.1"

import gettext
import os
Expand Down
2 changes: 2 additions & 0 deletions src/fmetools/features.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
These utilities make it more convenient to work with FMEFeature objects,
and help avoid common errors.
"""
from __future__ import annotations

from typing import Any, Iterable, Optional

from fmeobjects import FME_ATTR_STRING, FMEFeature, FMEGeometry, kFMERead_Geometry
Expand Down
6 changes: 4 additions & 2 deletions src/fmetools/localize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"""
Helpers for enabling localized strings using the :mod:`gettext` module.
"""
from __future__ import annotations

import os
from typing import Callable, Optional

Expand All @@ -21,7 +23,7 @@ def enable_module_localization(
python_module_name: str,
locale_dir: Optional[str] = None,
enable_fallback: bool = True,
**kwargs
**kwargs,
) -> Callable:
"""
Attempt to load localized messages.
Expand Down Expand Up @@ -51,7 +53,7 @@ def enable_module_localization_with_plurals(
python_module_name: str,
locale_dir: Optional[str] = None,
enable_fallback: bool = True,
**kwargs
**kwargs,
) -> tuple[Callable, Callable]:
"""
Attempt to load localized messages. Supports localized strings which specify plurals.
Expand Down
2 changes: 2 additions & 0 deletions src/fmetools/paramparsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
.. note::
This module can only be imported in FME 2023 or newer.
"""
from __future__ import annotations

from typing import Any, Iterable, Optional, Union

from fmetools.features import get_attributes, get_attributes_with_prefix
Expand Down
2 changes: 2 additions & 0 deletions src/fmetools/webservices.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"""
Helpers for working with FME Named Connections and FME Web Services.
"""
from __future__ import annotations

from typing import Union

import requests
Expand Down

0 comments on commit 9e7e54e

Please sign in to comment.