From 2f072389aedc2b4a5d7a4930d458db39edb56060 Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Wed, 24 Jul 2024 19:33:45 -0300 Subject: [PATCH 1/2] support numpy 2.0 and pandas 2.0 Breaking Changes: - Numpy 2.0 require Python >=3.9 - Drop support for Python 3.7 and 3.9 --- .github/workflows/python-package.yml | 2 +- README.md | 2 +- pandavro/__init__.py | 2 +- setup.py | 7 +++---- tox.ini | 9 ++------- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 36cc84b..a6cbc77 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index ce7e8da..9578e9f 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Pandavro can handle these primitive types: | np.bool_ | boolean | | np.float32 | float | | np.float64 | double | -| np.unicode_ | string | +| np.str_ | string | | np.object_ | string | | np.int8, np.int16, np.int32 | int | | np.uint8, np.uint16, np.uint32 | "unsigned" int* | diff --git a/pandavro/__init__.py b/pandavro/__init__.py index 28d59e0..84fe380 100644 --- a/pandavro/__init__.py +++ b/pandavro/__init__.py @@ -19,7 +19,7 @@ np.int64: 'long', np.uint64: {'type': 'long', 'unsigned': True}, np.dtype('O'): 'complex', # FIXME: Don't automatically store objects as strings - np.unicode_: 'string', + np.str_: 'string', np.float32: 'float', np.float64: 'double', np.datetime64: {'type': 'long', 'logicalType': 'timestamp-micros'}, diff --git a/setup.py b/setup.py index 1ce2dc8..7c03330 100644 --- a/setup.py +++ b/setup.py @@ -19,13 +19,12 @@ install_requires=[ # fixed versions. 'fastavro>=1.5.1,<2.0.0', - 'pandas>=1.1', - # https://pandas.pydata.org/pandas-docs/version/1.1/getting_started/install.html#dependencies - 'numpy>=1.15.4', + 'pandas>=2.0,<3.0.0', + 'numpy>=2.0', ], extras_require={ 'tests': ['pytest==7.3.2', 'tox==4.6.0'], }, # https://pandas.pydata.org/pandas-docs/version/1.1/getting_started/install.html#python-version-support - python_requires='>=3.7.0', + python_requires='>=3.9.0', ) diff --git a/tox.ini b/tox.ini index 9332bd5..739e4aa 100644 --- a/tox.ini +++ b/tox.ini @@ -1,15 +1,11 @@ [tox] envlist = - # pandas 2.0 doesn't support python 3.7 - py37-pandas{1}-fastavro{15,16,17,1}, - py{38,39,310}-pandas{1,2}-fastavro{15,16,17,18,1}, - py{311}-pandas{1,2}-fastavro{17,18,1}, + py{39,310}-pandas{2}-fastavro{15,16,17,18,1}, + py{311}-pandas{2}-fastavro{17,18,1}, py{312}-pandas{2}-fastavro{18,1}, [gh-actions] python = - 3.7: py37 - 3.8: py38 3.9: py39 3.10: py310 3.11: py311 @@ -18,7 +14,6 @@ python = [testenv] deps = pytest - pandas1: pandas >=1.1, <2 pandas2: pandas >=2.0.0, <3.0.0 fastavro15: fastavro >=1.5.1, <1.6.0 fastavro16: fastavro >=1.6.0, <1.7.0 From 64132c8e0013a80f9d8473c5e6dd646e33d1c56d Mon Sep 17 00:00:00 2001 From: Pedro Castro Date: Thu, 17 Oct 2024 10:37:14 -0300 Subject: [PATCH 2/2] Update setup.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Corentin RĂ©gent <95936677+corentin-regent@users.noreply.github.com> --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7c03330..c938362 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ # fixed versions. 'fastavro>=1.5.1,<2.0.0', 'pandas>=2.0,<3.0.0', - 'numpy>=2.0', + 'numpy>=2.0,<3.0.0', ], extras_require={ 'tests': ['pytest==7.3.2', 'tox==4.6.0'],