From c774f3d978b47bc924a7b65fd841225b8bf51b7b Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 15 Sep 2020 20:11:18 -0500 Subject: [PATCH 1/7] BLD/CI: fix py39 ci #36296 --- .travis.yml | 3 --- ci/build39.sh | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2e98cf47aea3e..93c8238bb5059 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,9 +62,6 @@ matrix: - arch: arm64 env: - JOB="3.7, arm64" PYTEST_WORKERS=8 ENV_FILE="ci/deps/travis-37-arm64.yaml" PATTERN="(not slow and not network and not clipboard)" - - dist: bionic - env: - - JOB="3.9-dev" PATTERN="(not slow and not network and not clipboard)" before_install: diff --git a/ci/build39.sh b/ci/build39.sh index b9c76635df99b..f2ef11d5a71f4 100755 --- a/ci/build39.sh +++ b/ci/build39.sh @@ -3,8 +3,7 @@ sudo apt-get install build-essential gcc xvfb pip install --no-deps -U pip wheel setuptools -pip install numpy python-dateutil pytz pytest pytest-xdist hypothesis -pip install cython --pre # https://github.com/cython/cython/issues/3395 +pip install cython numpy python-dateutil pytz pytest pytest-xdist hypothesis python setup.py build_ext -inplace python -m pip install --no-build-isolation -e . From 3c4633e72c9ea4f06bdf3a00356a19167a8115f3 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 15 Sep 2020 21:02:34 -0500 Subject: [PATCH 2/7] BLD/CI fix deprecated unicode lenght check #36296 --- pandas/_libs/writers.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/writers.pyx b/pandas/_libs/writers.pyx index 40c39aabb7a7a..918b150dc8b99 100644 --- a/pandas/_libs/writers.pyx +++ b/pandas/_libs/writers.pyx @@ -2,7 +2,7 @@ import cython from cython import Py_ssize_t from cpython.bytes cimport PyBytes_GET_SIZE -from cpython.unicode cimport PyUnicode_GET_SIZE +from cpython.unicode cimport PyUnicode_GET_LENGTH import numpy as np @@ -144,7 +144,7 @@ cpdef inline Py_ssize_t word_len(object val): Py_ssize_t l = 0 if isinstance(val, str): - l = PyUnicode_GET_SIZE(val) + l = PyUnicode_GET_LENGTH(val) elif isinstance(val, bytes): l = PyBytes_GET_SIZE(val) From 95e05944ad62ec550b59c208be41bf20c2b69a13 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 15 Sep 2020 21:39:06 -0500 Subject: [PATCH 3/7] BLD/CI add py39 compat check --- pandas/_libs/writers.pyx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/writers.pyx b/pandas/_libs/writers.pyx index 918b150dc8b99..3e7c2743b0abf 100644 --- a/pandas/_libs/writers.pyx +++ b/pandas/_libs/writers.pyx @@ -2,12 +2,18 @@ import cython from cython import Py_ssize_t from cpython.bytes cimport PyBytes_GET_SIZE -from cpython.unicode cimport PyUnicode_GET_LENGTH import numpy as np from numpy cimport ndarray, uint8_t +from pandas.compat import PY39 + +if PY39: + from cpython.unicode cimport PyUnicode_GET_LENGTH as Unicode_GET_LENGTH +else: + from cpython.unicode cimport PyUnicode_GET_SIZE as Unicode_GET_LENGTH + ctypedef fused pandas_string: str bytes @@ -144,7 +150,7 @@ cpdef inline Py_ssize_t word_len(object val): Py_ssize_t l = 0 if isinstance(val, str): - l = PyUnicode_GET_LENGTH(val) + l = Unicode_GET_LENGTH(val) elif isinstance(val, bytes): l = PyBytes_GET_SIZE(val) From 0ee32166aed02ad4a30ca037b74983d0d96317be Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 15 Sep 2020 22:41:51 -0500 Subject: [PATCH 4/7] BLD/CI bump cython version --- ci/deps/azure-37-minimum_versions.yaml | 2 +- ci/deps/azure-38-numpydev.yaml | 2 +- pandas/_libs/writers.pyx | 11 ++--------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/ci/deps/azure-37-minimum_versions.yaml b/ci/deps/azure-37-minimum_versions.yaml index 31f82f3304db3..afd5b07cc6654 100644 --- a/ci/deps/azure-37-minimum_versions.yaml +++ b/ci/deps/azure-37-minimum_versions.yaml @@ -5,7 +5,7 @@ dependencies: - python=3.7.1 # tools - - cython=0.29.16 + - cython=0.29.21 - pytest=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/azure-38-numpydev.yaml b/ci/deps/azure-38-numpydev.yaml index 37592086d49e3..274be0361c2e5 100644 --- a/ci/deps/azure-38-numpydev.yaml +++ b/ci/deps/azure-38-numpydev.yaml @@ -14,7 +14,7 @@ dependencies: - pytz - pip - pip: - - cython==0.29.16 # GH#34014 + - cython==0.29.21 # GH#34014 - "git+git://github.com/dateutil/dateutil.git" - "--extra-index-url https://pypi.anaconda.org/scipy-wheels-nightly/simple" - "--pre" diff --git a/pandas/_libs/writers.pyx b/pandas/_libs/writers.pyx index 3e7c2743b0abf..eaab5dfe35953 100644 --- a/pandas/_libs/writers.pyx +++ b/pandas/_libs/writers.pyx @@ -1,19 +1,12 @@ import cython -from cython import Py_ssize_t from cpython.bytes cimport PyBytes_GET_SIZE import numpy as np +from cpython cimport PyUnicode_GET_LENGTH from numpy cimport ndarray, uint8_t -from pandas.compat import PY39 - -if PY39: - from cpython.unicode cimport PyUnicode_GET_LENGTH as Unicode_GET_LENGTH -else: - from cpython.unicode cimport PyUnicode_GET_SIZE as Unicode_GET_LENGTH - ctypedef fused pandas_string: str bytes @@ -150,7 +143,7 @@ cpdef inline Py_ssize_t word_len(object val): Py_ssize_t l = 0 if isinstance(val, str): - l = Unicode_GET_LENGTH(val) + l = PyUnicode_GET_LENGTH(val) elif isinstance(val, bytes): l = PyBytes_GET_SIZE(val) From e0f4ee1b352f287540f087583a325e6965925423 Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Tue, 15 Sep 2020 23:03:13 -0500 Subject: [PATCH 5/7] BLD/CI clean import --- pandas/_libs/writers.pyx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pandas/_libs/writers.pyx b/pandas/_libs/writers.pyx index eaab5dfe35953..f6823c3cb0d3f 100644 --- a/pandas/_libs/writers.pyx +++ b/pandas/_libs/writers.pyx @@ -1,10 +1,7 @@ import cython - -from cpython.bytes cimport PyBytes_GET_SIZE - import numpy as np -from cpython cimport PyUnicode_GET_LENGTH +from cpython cimport PyBytes_GET_SIZE, PyUnicode_GET_LENGTH from numpy cimport ndarray, uint8_t ctypedef fused pandas_string: From 9bf1a55ccba1dd5f15fc4659e188b6b0d01cdf0e Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Wed, 16 Sep 2020 08:03:29 -0500 Subject: [PATCH 6/7] BLD/CI bump cython version, add doc --- asv_bench/asv.conf.json | 2 +- ci/deps/azure-37-32bit.yaml | 2 +- ci/deps/azure-37-locale.yaml | 2 +- ci/deps/azure-37-locale_slow.yaml | 2 +- ci/deps/azure-37-slow.yaml | 2 +- ci/deps/azure-38-locale.yaml | 2 +- ci/deps/azure-macos-37.yaml | 2 +- ci/deps/azure-windows-37.yaml | 2 +- ci/deps/azure-windows-38.yaml | 2 +- ci/deps/travis-37-arm64.yaml | 2 +- ci/deps/travis-37-cov.yaml | 2 +- ci/deps/travis-37-locale.yaml | 2 +- ci/deps/travis-37.yaml | 2 +- ci/deps/travis-38.yaml | 2 +- doc/source/whatsnew/v1.1.3.rst | 15 +++++++++++++++ environment.yml | 2 +- pyproject.toml | 2 +- requirements-dev.txt | 2 +- setup.py | 2 +- 19 files changed, 33 insertions(+), 18 deletions(-) diff --git a/asv_bench/asv.conf.json b/asv_bench/asv.conf.json index 1863a17e3d5f7..e8e82edabbfa3 100644 --- a/asv_bench/asv.conf.json +++ b/asv_bench/asv.conf.json @@ -39,7 +39,7 @@ // followed by the pip installed packages). "matrix": { "numpy": [], - "Cython": ["0.29.16"], + "Cython": ["0.29.21"], "matplotlib": [], "sqlalchemy": [], "scipy": [], diff --git a/ci/deps/azure-37-32bit.yaml b/ci/deps/azure-37-32bit.yaml index 8e0cd73a9536d..3cdd98485f281 100644 --- a/ci/deps/azure-37-32bit.yaml +++ b/ci/deps/azure-37-32bit.yaml @@ -21,6 +21,6 @@ dependencies: # see comment above - pip - pip: - - cython>=0.29.16 + - cython>=0.29.21 - numpy>=1.16.5 - pytest>=5.0.1 diff --git a/ci/deps/azure-37-locale.yaml b/ci/deps/azure-37-locale.yaml index cc996f4077cd9..64480258fe65e 100644 --- a/ci/deps/azure-37-locale.yaml +++ b/ci/deps/azure-37-locale.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - pytest-asyncio diff --git a/ci/deps/azure-37-locale_slow.yaml b/ci/deps/azure-37-locale_slow.yaml index fbb1ea671d696..7f658fe62d268 100644 --- a/ci/deps/azure-37-locale_slow.yaml +++ b/ci/deps/azure-37-locale_slow.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/azure-37-slow.yaml b/ci/deps/azure-37-slow.yaml index d17a8a2b0ed9b..13a0d442bcae7 100644 --- a/ci/deps/azure-37-slow.yaml +++ b/ci/deps/azure-37-slow.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/azure-38-locale.yaml b/ci/deps/azure-38-locale.yaml index bb40127b672d3..8ce58e07a8542 100644 --- a/ci/deps/azure-38-locale.yaml +++ b/ci/deps/azure-38-locale.yaml @@ -5,7 +5,7 @@ dependencies: - python=3.8.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - pytest-asyncio>=0.12.0 diff --git a/ci/deps/azure-macos-37.yaml b/ci/deps/azure-macos-37.yaml index a5a69b9a59576..31e0ffca81424 100644 --- a/ci/deps/azure-macos-37.yaml +++ b/ci/deps/azure-macos-37.yaml @@ -31,6 +31,6 @@ dependencies: - xlwt - pip - pip: - - cython>=0.29.16 + - cython>=0.29.21 - pyreadstat - pyxlsb diff --git a/ci/deps/azure-windows-37.yaml b/ci/deps/azure-windows-37.yaml index 1d15ca41c0f8e..16b4bd72683b4 100644 --- a/ci/deps/azure-windows-37.yaml +++ b/ci/deps/azure-windows-37.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/azure-windows-38.yaml b/ci/deps/azure-windows-38.yaml index 23bede5eb26f1..449bbd05991bf 100644 --- a/ci/deps/azure-windows-38.yaml +++ b/ci/deps/azure-windows-38.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.8.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/travis-37-arm64.yaml b/ci/deps/travis-37-arm64.yaml index ea29cbef1272b..d04b1ca0bdcfc 100644 --- a/ci/deps/travis-37-arm64.yaml +++ b/ci/deps/travis-37-arm64.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - cython>=0.29.13 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/travis-37-cov.yaml b/ci/deps/travis-37-cov.yaml index 33ee6dfffb1a3..d031dc1cc062f 100644 --- a/ci/deps/travis-37-cov.yaml +++ b/ci/deps/travis-37-cov.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/travis-37-locale.yaml b/ci/deps/travis-37-locale.yaml index 306f74a0101e3..8a0b5b043ceca 100644 --- a/ci/deps/travis-37-locale.yaml +++ b/ci/deps/travis-37-locale.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/travis-37.yaml b/ci/deps/travis-37.yaml index 26d6c2910a7cc..6a15ce1195ea9 100644 --- a/ci/deps/travis-37.yaml +++ b/ci/deps/travis-37.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.7.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/ci/deps/travis-38.yaml b/ci/deps/travis-38.yaml index b879c0f81dab2..874c8dd96d008 100644 --- a/ci/deps/travis-38.yaml +++ b/ci/deps/travis-38.yaml @@ -6,7 +6,7 @@ dependencies: - python=3.8.* # tools - - cython>=0.29.16 + - cython>=0.29.21 - pytest>=5.0.1 - pytest-xdist>=1.21 - hypothesis>=3.58.0 diff --git a/doc/source/whatsnew/v1.1.3.rst b/doc/source/whatsnew/v1.1.3.rst index 8ead78a17e9c2..72526140b6eb8 100644 --- a/doc/source/whatsnew/v1.1.3.rst +++ b/doc/source/whatsnew/v1.1.3.rst @@ -10,6 +10,21 @@ including other versions of pandas. .. --------------------------------------------------------------------------- +Enhancements +~~~~~~~~~~~~ + +Added support for new Python version +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Pandas 1.1.3 now supports Python 3.9 (:issue:`36296`). + +Development Changes +^^^^^^^^^^^^^^^^^^^ + +- The minimum version of Cython is now the most recent bug-fix version (0.29.21) (:issue:`36296`). + +.. --------------------------------------------------------------------------- + .. _whatsnew_113.regressions: Fixed regressions diff --git a/environment.yml b/environment.yml index badb0ba94a670..36bbd3d307159 100644 --- a/environment.yml +++ b/environment.yml @@ -12,7 +12,7 @@ dependencies: - asv # building - - cython>=0.29.16 + - cython>=0.29.21 # code checks - black=19.10b0 diff --git a/pyproject.toml b/pyproject.toml index f6f8081b6c464..8161e8ad752da 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = [ "setuptools", "wheel", - "Cython>=0.29.16,<3", # Note: sync with setup.py + "Cython>=0.29.21,<3", # Note: sync with setup.py "numpy==1.16.5; python_version=='3.7' and platform_system!='AIX'", "numpy==1.17.3; python_version>='3.8' and platform_system!='AIX'", "numpy==1.16.5; python_version=='3.7' and platform_system=='AIX'", diff --git a/requirements-dev.txt b/requirements-dev.txt index c53ced35d27fa..fb647c10f72bc 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,7 +5,7 @@ numpy>=1.16.5 python-dateutil>=2.7.3 pytz asv -cython>=0.29.16 +cython>=0.29.21 black==19.10b0 cpplint flake8<3.8.0 diff --git a/setup.py b/setup.py index f6f0cd9aabc0e..364094129f63e 100755 --- a/setup.py +++ b/setup.py @@ -34,7 +34,7 @@ def is_platform_mac(): min_numpy_ver = "1.16.5" -min_cython_ver = "0.29.16" # note: sync with pyproject.toml +min_cython_ver = "0.29.21" # note: sync with pyproject.toml try: import Cython From 6c13d7c85e9b1ee5e3f94ce3585a28e75b4cf72d Mon Sep 17 00:00:00 2001 From: Fangchen Li Date: Wed, 16 Sep 2020 09:13:55 -0500 Subject: [PATCH 7/7] BLD/CI update install.rst --- doc/source/getting_started/install.rst | 2 +- setup.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/getting_started/install.rst b/doc/source/getting_started/install.rst index fde9f567cc3ec..2196c908ecf37 100644 --- a/doc/source/getting_started/install.rst +++ b/doc/source/getting_started/install.rst @@ -18,7 +18,7 @@ Instructions for installing from source, Python version support ---------------------- -Officially Python 3.7.1 and above, and 3.8. +Officially Python 3.7.1 and above, 3.8, and 3.9. Installing pandas ----------------- diff --git a/setup.py b/setup.py index 364094129f63e..a8dfeb0974195 100755 --- a/setup.py +++ b/setup.py @@ -199,6 +199,7 @@ def build_extensions(self): "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", "Programming Language :: Cython", "Topic :: Scientific/Engineering", ]