Skip to content

Commit

Permalink
Merge pull request #46 from IAMconsortium/fix/py37
Browse files Browse the repository at this point in the history
Add typing_extensions to py3.7 deps for Literal
  • Loading branch information
khaeru authored Sep 12, 2023
2 parents a20cd37 + 708865e commit e22eab6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.x"
cache: pip
cache-dependency-path: "**/pyproject.toml"

Expand Down
8 changes: 7 additions & 1 deletion iam_units/currency.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
See the inline comments (NB) for possible extensions of this code; also
iam_units.update.currency.
"""
from typing import Literal, Union
from typing import Union

try:
from typing import Literal
except ImportError:
from typing_extensions import Literal # type: ignore [assignment]


#: Exchange rate data for method=EXC, period=2005, from
#: https://data.oecd.org/conversion/exchange-rates.htm
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
]
dependencies = ["pint >= 0.11"]
dependencies = ["pint >= 0.11", "typing_extensions; python_version < '3.8'"]

[project.urls]
homepage = "https://github.com/IAMconsortium/units"
Expand Down

0 comments on commit e22eab6

Please sign in to comment.