Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typing-extensions to dependencies #5503

Merged
merged 5 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/getting-started-guide/installing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Required dependencies

- Python (3.7 or later)
- setuptools (40.4 or later)
- typing-extensions
Copy link
Contributor

@dcherian dcherian Jun 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add (3.10 or later). I had to update my version to get TypeGuard and also in setup.cfg

- `numpy <http://www.numpy.org/>`__ (1.17 or later)
- `pandas <http://pandas.pydata.org/>`__ (1.0 or later)

Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ install_requires =
numpy >= 1.17
pandas >= 1.0
setuptools >= 40.4 # For pkg_resources
typing-extensions # Backported type hints

[options.extras_require]
io =
Expand Down
8 changes: 7 additions & 1 deletion xarray/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import itertools
import os
import re
import sys
import warnings
from enum import Enum
from typing import (
Expand All @@ -30,7 +31,12 @@

import numpy as np
import pandas as pd
from typing_extensions import TypeGuard

if sys.version_info >= (3, 10):
from typing import TypeGuard
else:
from typing_extensions import TypeGuard
malmans2 marked this conversation as resolved.
Show resolved Hide resolved


K = TypeVar("K")
V = TypeVar("V")
Expand Down