From 1807a23fcc61247a076953d83dd98b1990922409 Mon Sep 17 00:00:00 2001 From: Vaibhav Vishal Date: Wed, 3 Apr 2019 18:50:03 +0530 Subject: [PATCH 1/5] add typing_extensions to enviromnent and requirements --- environment.yml | 1 + requirements-dev.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/environment.yml b/environment.yml index a1042be48156c..9c2e29e19e1b4 100644 --- a/environment.yml +++ b/environment.yml @@ -25,6 +25,7 @@ dependencies: - pytest-mock - sphinx - numpydoc + - typing_extensions # optional - beautifulsoup4>=4.2.1 diff --git a/requirements-dev.txt b/requirements-dev.txt index 173441489b388..19d4aabb9d839 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,6 +16,7 @@ pytest>=4.0.2 pytest-mock sphinx numpydoc +typing_extensions beautifulsoup4>=4.2.1 blosc botocore>=1.11 From 040b2eed29e4a6052c99e8ffe219b6687633e787 Mon Sep 17 00:00:00 2001 From: Vaibhav Vishal Date: Fri, 5 Apr 2019 14:43:48 +0530 Subject: [PATCH 2/5] fix Type import for py3.5.1 --- pandas/core/arrays/datetimelike.py | 3 ++- pandas/core/arrays/sparse.py | 3 ++- pandas/core/dtypes/base.py | 4 +++- pandas/core/groupby/groupby.py | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index e1e6e2c3e750b..ba9dd9326d19c 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.period import ( diff --git a/pandas/core/arrays/sparse.py b/pandas/core/arrays/sparse.py index 288035d824b8b..00167fd0d5ff1 100644 --- a/pandas/core/arrays/sparse.py +++ b/pandas/core/arrays/sparse.py @@ -5,10 +5,11 @@ import numbers import operator import re -from typing import Any, Callable, Type, Union +from typing import Any, Callable, Union import warnings import numpy as np +from typing_extensions import Type from pandas._libs import index as libindex, lib import pandas._libs.sparse as splib diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index 9e7d771abe342..705ffa39cde19 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, Type +from typing import List, Optional 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 2494cf55d2e0d..d5e35428e960a 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 From 0ad54e1cccf587d3c927ca72713fe1980deaf4f4 Mon Sep 17 00:00:00 2001 From: Vaibhav Vishal Date: Fri, 5 Apr 2019 16:39:16 +0530 Subject: [PATCH 3/5] update CI deps to install typying_extensions --- ci/deps/azure-35-compat.yaml | 1 + ci/deps/azure-36-locale.yaml | 1 + ci/deps/azure-36-locale_slow.yaml | 1 + ci/deps/azure-37-locale.yaml | 1 + ci/deps/azure-37-numpydev.yaml | 1 + ci/deps/azure-macos-35.yaml | 1 + ci/deps/azure-windows-36.yaml | 1 + ci/deps/azure-windows-37.yaml | 1 + ci/deps/travis-36-cov.yaml | 1 + ci/deps/travis-36-doc.yaml | 1 + ci/deps/travis-36-locale.yaml | 1 + ci/deps/travis-36-slow.yaml | 1 + ci/deps/travis-37.yaml | 1 + 13 files changed, 13 insertions(+) diff --git a/ci/deps/azure-35-compat.yaml b/ci/deps/azure-35-compat.yaml index d0a48bd3f8b27..e02d89cdb543b 100644 --- a/ci/deps/azure-35-compat.yaml +++ b/ci/deps/azure-35-compat.yaml @@ -24,6 +24,7 @@ dependencies: - pytest-mock - isort - pip + - typing_extensions - pip: # for python 3.5, pytest>=4.0.2 is not available in conda - pytest>=4.0.2 diff --git a/ci/deps/azure-36-locale.yaml b/ci/deps/azure-36-locale.yaml index f43ed0249985e..ecbb64d0cdab2 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..ea7eab50e6733 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..f278e90b107dc 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..aaf77afba4f44 100644 --- a/ci/deps/azure-37-numpydev.yaml +++ b/ci/deps/azure-37-numpydev.yaml @@ -12,6 +12,7 @@ dependencies: - hypothesis>=3.58.0 - isort - pip + - typing_extensions - pip: - "git+git://github.com/dateutil/dateutil.git" - "-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" diff --git a/ci/deps/azure-macos-35.yaml b/ci/deps/azure-macos-35.yaml index 591266348a5f1..3a0d24549fce9 100644 --- a/ci/deps/azure-macos-35.yaml +++ b/ci/deps/azure-macos-35.yaml @@ -22,6 +22,7 @@ dependencies: - xlsxwriter - xlwt - isort + - typing_extensions - pip: - python-dateutil==2.5.3 # universal diff --git a/ci/deps/azure-windows-36.yaml b/ci/deps/azure-windows-36.yaml index 7b3ae259fb8dd..08b02ca1f67a4 100644 --- a/ci/deps/azure-windows-36.yaml +++ b/ci/deps/azure-windows-36.yaml @@ -28,3 +28,4 @@ dependencies: - pytest-mock - hypothesis>=3.58.0 - isort + - typing_extensions diff --git a/ci/deps/azure-windows-37.yaml b/ci/deps/azure-windows-37.yaml index 5384e794d442a..72e2883d2fa6b 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..1ffc4f0ac306b 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..d2ac41dca3adc 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..0b493b6a2fa95 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..acfd9781c6b32 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..54a19de5b0650 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 From 3c31c1cfe8df486aa0fc4b24d8025b8ddd2b724f Mon Sep 17 00:00:00 2001 From: Vaibhav Vishal Date: Fri, 5 Apr 2019 16:50:34 +0530 Subject: [PATCH 4/5] spell typing-extensions properly --- ci/deps/azure-35-compat.yaml | 2 +- ci/deps/azure-36-locale.yaml | 2 +- ci/deps/azure-36-locale_slow.yaml | 2 +- ci/deps/azure-37-locale.yaml | 2 +- ci/deps/azure-37-numpydev.yaml | 2 +- ci/deps/azure-macos-35.yaml | 2 +- ci/deps/azure-windows-36.yaml | 2 +- ci/deps/azure-windows-37.yaml | 2 +- ci/deps/travis-36-cov.yaml | 2 +- ci/deps/travis-36-doc.yaml | 2 +- ci/deps/travis-36-locale.yaml | 2 +- ci/deps/travis-36-slow.yaml | 2 +- ci/deps/travis-37.yaml | 2 +- environment.yml | 2 +- requirements-dev.txt | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ci/deps/azure-35-compat.yaml b/ci/deps/azure-35-compat.yaml index e02d89cdb543b..3487d26e8d6f7 100644 --- a/ci/deps/azure-35-compat.yaml +++ b/ci/deps/azure-35-compat.yaml @@ -24,7 +24,7 @@ dependencies: - pytest-mock - isort - pip - - typing_extensions + - typing-extensions - pip: # for python 3.5, pytest>=4.0.2 is not available in conda - pytest>=4.0.2 diff --git a/ci/deps/azure-36-locale.yaml b/ci/deps/azure-36-locale.yaml index ecbb64d0cdab2..a3e712d555617 100644 --- a/ci/deps/azure-36-locale.yaml +++ b/ci/deps/azure-36-locale.yaml @@ -26,6 +26,6 @@ dependencies: - hypothesis>=3.58.0 - isort - pip - - typing_extensions + - 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 ea7eab50e6733..f65facfd9233b 100644 --- a/ci/deps/azure-36-locale_slow.yaml +++ b/ci/deps/azure-36-locale_slow.yaml @@ -32,6 +32,6 @@ dependencies: - moto - isort - pip - - typing_extensions + - typing-extensions - pip: - hypothesis>=3.58.0 diff --git a/ci/deps/azure-37-locale.yaml b/ci/deps/azure-37-locale.yaml index f278e90b107dc..a4ae729412305 100644 --- a/ci/deps/azure-37-locale.yaml +++ b/ci/deps/azure-37-locale.yaml @@ -30,7 +30,7 @@ dependencies: - pytest-mock - isort - pip - - typing_extensions + - 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 aaf77afba4f44..bc4b945a338a2 100644 --- a/ci/deps/azure-37-numpydev.yaml +++ b/ci/deps/azure-37-numpydev.yaml @@ -12,7 +12,7 @@ dependencies: - hypothesis>=3.58.0 - isort - pip - - typing_extensions + - typing-extensions - pip: - "git+git://github.com/dateutil/dateutil.git" - "-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" diff --git a/ci/deps/azure-macos-35.yaml b/ci/deps/azure-macos-35.yaml index 3a0d24549fce9..01c32d389da0d 100644 --- a/ci/deps/azure-macos-35.yaml +++ b/ci/deps/azure-macos-35.yaml @@ -22,7 +22,7 @@ dependencies: - xlsxwriter - xlwt - isort - - typing_extensions + - typing-extensions - pip: - python-dateutil==2.5.3 # universal diff --git a/ci/deps/azure-windows-36.yaml b/ci/deps/azure-windows-36.yaml index 08b02ca1f67a4..bdf3700a81d86 100644 --- a/ci/deps/azure-windows-36.yaml +++ b/ci/deps/azure-windows-36.yaml @@ -28,4 +28,4 @@ dependencies: - pytest-mock - hypothesis>=3.58.0 - isort - - typing_extensions + - typing-extensions diff --git a/ci/deps/azure-windows-37.yaml b/ci/deps/azure-windows-37.yaml index 72e2883d2fa6b..a572e84a355b5 100644 --- a/ci/deps/azure-windows-37.yaml +++ b/ci/deps/azure-windows-37.yaml @@ -31,4 +31,4 @@ dependencies: - moto - hypothesis>=3.58.0 - isort - - typing_extensions + - typing-extensions diff --git a/ci/deps/travis-36-cov.yaml b/ci/deps/travis-36-cov.yaml index 1ffc4f0ac306b..3f6a53eb36bc7 100644 --- a/ci/deps/travis-36-cov.yaml +++ b/ci/deps/travis-36-cov.yaml @@ -43,7 +43,7 @@ dependencies: - hypothesis>=3.58.0 - isort - pip - - typing_extensions + - typing-extensions - pip: - brotlipy - coverage diff --git a/ci/deps/travis-36-doc.yaml b/ci/deps/travis-36-doc.yaml index d2ac41dca3adc..9ffb32fe2721e 100644 --- a/ci/deps/travis-36-doc.yaml +++ b/ci/deps/travis-36-doc.yaml @@ -44,4 +44,4 @@ dependencies: - pytest>=4.0.2 - pytest-xdist - isort - - typing_extensions + - typing-extensions diff --git a/ci/deps/travis-36-locale.yaml b/ci/deps/travis-36-locale.yaml index 0b493b6a2fa95..5bd0c36076157 100644 --- a/ci/deps/travis-36-locale.yaml +++ b/ci/deps/travis-36-locale.yaml @@ -41,6 +41,6 @@ dependencies: - moto - isort - pip - - typing_extensions + - typing-extensions - pip: - hypothesis>=3.58.0 diff --git a/ci/deps/travis-36-slow.yaml b/ci/deps/travis-36-slow.yaml index acfd9781c6b32..ee6b98f2b5e72 100644 --- a/ci/deps/travis-36-slow.yaml +++ b/ci/deps/travis-36-slow.yaml @@ -31,4 +31,4 @@ dependencies: - moto - hypothesis>=3.58.0 - isort - - typing_extensions + - typing-extensions diff --git a/ci/deps/travis-37.yaml b/ci/deps/travis-37.yaml index 54a19de5b0650..998f1f7140458 100644 --- a/ci/deps/travis-37.yaml +++ b/ci/deps/travis-37.yaml @@ -20,6 +20,6 @@ dependencies: - s3fs - isort - pip - - typing_extensions + - typing-extensions - pip: - moto diff --git a/environment.yml b/environment.yml index 15dd6a917f680..4355b72e56884 100644 --- a/environment.yml +++ b/environment.yml @@ -25,7 +25,7 @@ dependencies: - pytest-mock - sphinx - numpydoc - - typing_extensions + - typing-extensions - pip # optional diff --git a/requirements-dev.txt b/requirements-dev.txt index fed2f02fee92d..c07a72ed0be2f 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,7 +16,7 @@ pytest>=4.0.2 pytest-mock sphinx numpydoc -typing_extensions +typing-extensions pip beautifulsoup4>=4.2.1 blosc From 4abfc680d63cb3d9c98acffb7e5a0572a38a231a Mon Sep 17 00:00:00 2001 From: Vaibhav Vishal Date: Tue, 16 Apr 2019 11:30:57 +0530 Subject: [PATCH 5/5] trying to fix ci tests --- ci/deps/azure-35-compat.yaml | 2 +- ci/deps/azure-37-numpydev.yaml | 2 +- ci/deps/azure-macos-35.yaml | 2 +- ci/deps/azure-windows-36.yaml | 1 - pandas/core/arrays/sparse.py | 1 - 5 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ci/deps/azure-35-compat.yaml b/ci/deps/azure-35-compat.yaml index 3487d26e8d6f7..75e67582f483d 100644 --- a/ci/deps/azure-35-compat.yaml +++ b/ci/deps/azure-35-compat.yaml @@ -24,8 +24,8 @@ dependencies: - pytest-mock - isort - pip - - typing-extensions - pip: # 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-37-numpydev.yaml b/ci/deps/azure-37-numpydev.yaml index bc4b945a338a2..650847bf6b4c3 100644 --- a/ci/deps/azure-37-numpydev.yaml +++ b/ci/deps/azure-37-numpydev.yaml @@ -12,10 +12,10 @@ dependencies: - hypothesis>=3.58.0 - isort - pip - - typing-extensions - pip: - "git+git://github.com/dateutil/dateutil.git" - "-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com" - "--pre" - "numpy" - "scipy" + - typing-extensions diff --git a/ci/deps/azure-macos-35.yaml b/ci/deps/azure-macos-35.yaml index 01c32d389da0d..eb158566a8c4b 100644 --- a/ci/deps/azure-macos-35.yaml +++ b/ci/deps/azure-macos-35.yaml @@ -22,7 +22,6 @@ dependencies: - xlsxwriter - xlwt - isort - - typing-extensions - pip: - python-dateutil==2.5.3 # universal @@ -30,3 +29,4 @@ dependencies: - pytest-xdist - pytest-mock - hypothesis>=3.58.0 + - typing-extensions diff --git a/ci/deps/azure-windows-36.yaml b/ci/deps/azure-windows-36.yaml index bdf3700a81d86..7b3ae259fb8dd 100644 --- a/ci/deps/azure-windows-36.yaml +++ b/ci/deps/azure-windows-36.yaml @@ -28,4 +28,3 @@ dependencies: - pytest-mock - hypothesis>=3.58.0 - isort - - typing-extensions diff --git a/pandas/core/arrays/sparse.py b/pandas/core/arrays/sparse.py index de6175443a809..2eb33d6d2c50f 100644 --- a/pandas/core/arrays/sparse.py +++ b/pandas/core/arrays/sparse.py @@ -9,7 +9,6 @@ import warnings import numpy as np -from typing_extensions import Type from pandas._libs import index as libindex, lib import pandas._libs.sparse as splib