diff --git a/ci/deps/azure-35-compat.yaml b/ci/deps/azure-35-compat.yaml index d0a48bd3f8b27..75e67582f483d 100644 --- a/ci/deps/azure-35-compat.yaml +++ b/ci/deps/azure-35-compat.yaml @@ -28,3 +28,4 @@ dependencies: # for python 3.5, pytest>=4.0.2 is not available in conda - pytest>=4.0.2 - html5lib==1.0b2 + - typing-extensions diff --git a/ci/deps/azure-36-locale.yaml b/ci/deps/azure-36-locale.yaml index f43ed0249985e..a3e712d555617 100644 --- a/ci/deps/azure-36-locale.yaml +++ b/ci/deps/azure-36-locale.yaml @@ -26,5 +26,6 @@ dependencies: - hypothesis>=3.58.0 - isort - pip + - typing-extensions - pip: - html5lib==1.0b2 diff --git a/ci/deps/azure-36-locale_slow.yaml b/ci/deps/azure-36-locale_slow.yaml index 2a0404614dcfc..f65facfd9233b 100644 --- a/ci/deps/azure-36-locale_slow.yaml +++ b/ci/deps/azure-36-locale_slow.yaml @@ -32,5 +32,6 @@ dependencies: - moto - isort - pip + - typing-extensions - pip: - hypothesis>=3.58.0 diff --git a/ci/deps/azure-37-locale.yaml b/ci/deps/azure-37-locale.yaml index 649f5892f174d..a4ae729412305 100644 --- a/ci/deps/azure-37-locale.yaml +++ b/ci/deps/azure-37-locale.yaml @@ -30,6 +30,7 @@ dependencies: - pytest-mock - isort - pip + - typing-extensions - pip: - hypothesis>=3.58.0 - moto # latest moto in conda-forge fails with 3.7, move to conda dependencies when this is fixed diff --git a/ci/deps/azure-37-numpydev.yaml b/ci/deps/azure-37-numpydev.yaml index 6848b9990b46e..650847bf6b4c3 100644 --- a/ci/deps/azure-37-numpydev.yaml +++ b/ci/deps/azure-37-numpydev.yaml @@ -18,3 +18,4 @@ dependencies: - "--pre" - "numpy" - "scipy" + - typing-extensions diff --git a/ci/deps/azure-macos-35.yaml b/ci/deps/azure-macos-35.yaml index 591266348a5f1..eb158566a8c4b 100644 --- a/ci/deps/azure-macos-35.yaml +++ b/ci/deps/azure-macos-35.yaml @@ -29,3 +29,4 @@ dependencies: - pytest-xdist - pytest-mock - hypothesis>=3.58.0 + - typing-extensions diff --git a/ci/deps/azure-windows-37.yaml b/ci/deps/azure-windows-37.yaml index 5384e794d442a..a572e84a355b5 100644 --- a/ci/deps/azure-windows-37.yaml +++ b/ci/deps/azure-windows-37.yaml @@ -31,3 +31,4 @@ dependencies: - moto - hypothesis>=3.58.0 - isort + - typing-extensions diff --git a/ci/deps/travis-36-cov.yaml b/ci/deps/travis-36-cov.yaml index 606b5bac8306d..3f6a53eb36bc7 100644 --- a/ci/deps/travis-36-cov.yaml +++ b/ci/deps/travis-36-cov.yaml @@ -43,6 +43,7 @@ dependencies: - hypothesis>=3.58.0 - isort - pip + - typing-extensions - pip: - brotlipy - coverage diff --git a/ci/deps/travis-36-doc.yaml b/ci/deps/travis-36-doc.yaml index 9d6cbd82fdc05..9ffb32fe2721e 100644 --- a/ci/deps/travis-36-doc.yaml +++ b/ci/deps/travis-36-doc.yaml @@ -44,3 +44,4 @@ dependencies: - pytest>=4.0.2 - pytest-xdist - isort + - typing-extensions diff --git a/ci/deps/travis-36-locale.yaml b/ci/deps/travis-36-locale.yaml index 1d219bbcb671c..5bd0c36076157 100644 --- a/ci/deps/travis-36-locale.yaml +++ b/ci/deps/travis-36-locale.yaml @@ -41,5 +41,6 @@ dependencies: - moto - isort - pip + - typing-extensions - pip: - hypothesis>=3.58.0 diff --git a/ci/deps/travis-36-slow.yaml b/ci/deps/travis-36-slow.yaml index 365c78c02f4d4..ee6b98f2b5e72 100644 --- a/ci/deps/travis-36-slow.yaml +++ b/ci/deps/travis-36-slow.yaml @@ -31,3 +31,4 @@ dependencies: - moto - hypothesis>=3.58.0 - isort + - typing-extensions diff --git a/ci/deps/travis-37.yaml b/ci/deps/travis-37.yaml index 4bf7d516711f7..998f1f7140458 100644 --- a/ci/deps/travis-37.yaml +++ b/ci/deps/travis-37.yaml @@ -20,5 +20,6 @@ dependencies: - s3fs - isort - pip + - typing-extensions - pip: - moto diff --git a/environment.yml b/environment.yml index 48b873d4c3a3d..4355b72e56884 100644 --- a/environment.yml +++ b/environment.yml @@ -25,6 +25,7 @@ dependencies: - pytest-mock - sphinx - numpydoc + - typing-extensions - pip # optional diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 6225dfcbe5c14..c263d41508756 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- from datetime import datetime, timedelta import operator -from typing import Any, Sequence, Tuple, Type, Union +from typing import Any, Sequence, Tuple, Union import warnings import numpy as np +from typing_extensions import Type from pandas._libs import NaT, NaTType, Timestamp, algos, iNaT, lib from pandas._libs.tslibs.c_timestamp import maybe_integer_op_deprecated diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index d08b663fbb538..6456a0963bcad 100644 --- a/pandas/core/dtypes/base.py +++ b/pandas/core/dtypes/base.py @@ -1,5 +1,5 @@ """Extend pandas with custom array types""" -from typing import List, Optional, Tuple, Type +from typing import List, Optional, Tuple import numpy as np @@ -7,6 +7,8 @@ from pandas.core.dtypes.generic import ABCDataFrame, ABCIndexClass, ABCSeries +from typing_extensions import Type + class _DtypeOpsMixin(object): # Not all of pandas' extension dtypes are compatibile with diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index b1936a8f5121f..ccf2a31589c32 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -12,10 +12,11 @@ class providing the base-class of operations. import datetime from functools import partial, wraps import types -from typing import Optional, Tuple, Type +from typing import Optional, Tuple import warnings import numpy as np +from typing_extensions import Type from pandas._config.config import option_context diff --git a/requirements-dev.txt b/requirements-dev.txt index 5600e43ea09c5..c07a72ed0be2f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,6 +16,7 @@ pytest>=4.0.2 pytest-mock sphinx numpydoc +typing-extensions pip beautifulsoup4>=4.2.1 blosc