From 15240d30aa4076d0965ee84747a0b35dbbafef37 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Mon, 19 Aug 2024 08:57:00 +0200 Subject: [PATCH 1/3] Support numpy>=2 --- CHANGELOG.rst | 5 +++++ Earthfile | 48 ++++++++++++++++++++++++------------------------ environment.yml | 2 +- pyproject.toml | 2 +- setup.py | 6 +++--- 5 files changed, 34 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1def5015a..709895aea 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,11 @@ Version history / changelog From version 2.0.0, turbodbc adapts semantic versioning. +Version 4.14.0 +-------------- + +* Support ``pyarrow=2` + Version 4.13.0 -------------- diff --git a/Earthfile b/Earthfile index eefc0cbc7..fa39fbe9b 100644 --- a/Earthfile +++ b/Earthfile @@ -136,7 +136,7 @@ test-python3.10-arrow7.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=7,<8" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -145,7 +145,7 @@ test-python3.10-arrow8.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=8,<9" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -154,7 +154,7 @@ test-python3.10-arrow9.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=9,<10" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -163,7 +163,7 @@ test-python3.10-arrow10.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=10,<11" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -172,7 +172,7 @@ test-python3.10-arrow11.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=11,<12" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -181,7 +181,7 @@ test-python3.10-arrow12.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=12,<13" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -190,7 +190,7 @@ test-python3.10-arrow13.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=13,<14" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -199,7 +199,7 @@ test-python3.10-arrow14.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=14,<15" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -208,7 +208,7 @@ test-python3.10-arrow15.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=15,<16" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -217,7 +217,7 @@ test-python3.10-arrow16.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=16,<17" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -226,7 +226,7 @@ test-python3.10-arrow17.x.x: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=17,<18" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.2,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.2" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -234,7 +234,7 @@ test-python3.10-arrow17.x.x: test-python3.10-arrow-nightly: ARG PYTHON_VERSION="3.10.2" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ - --build-arg NUMPY_VERSION_RULE=">=1.21.4,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.21.4" \ --build-arg CONDA_EXTRA="-c arrow-nightlies" \ +test/result /result @@ -244,7 +244,7 @@ test-python3.11-arrow7.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=7,<8" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -253,7 +253,7 @@ test-python3.11-arrow8.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=8,<9" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -262,7 +262,7 @@ test-python3.11-arrow9.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=9,<10" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -271,7 +271,7 @@ test-python3.11-arrow10.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=10,<11" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -280,7 +280,7 @@ test-python3.11-arrow11.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=11,<12" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -289,7 +289,7 @@ test-python3.11-arrow12.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=12,<13" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -298,7 +298,7 @@ test-python3.11-arrow13.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=13,<14" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -307,7 +307,7 @@ test-python3.11-arrow14.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=14,<15" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -316,7 +316,7 @@ test-python3.11-arrow15.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=15,<16" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -325,7 +325,7 @@ test-python3.11-arrow16.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=16,<17" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -334,7 +334,7 @@ test-python3.11-arrow17.x.x: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ --build-arg ARROW_VERSION_RULE=">=17,<18" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ +test/result /result SAVE ARTIFACT /result AS LOCAL result @@ -342,7 +342,7 @@ test-python3.11-arrow17.x.x: test-python3.11-arrow-nightly: ARG PYTHON_VERSION="3.11.3" COPY --build-arg PYTHON_VERSION="$PYTHON_VERSION" \ - --build-arg NUMPY_VERSION_RULE=">=1.23.3,<2" \ + --build-arg NUMPY_VERSION_RULE=">=1.23.3" \ --build-arg CONDA_EXTRA="-c arrow-nightlies" \ +test/result /result diff --git a/environment.yml b/environment.yml index 4165abe08..965bf8265 100644 --- a/environment.yml +++ b/environment.yml @@ -14,6 +14,6 @@ dependencies: - pkg-config - ninja - pytest - - numpy<2 + - numpy>=1.20 - pybind11 - simdutf diff --git a/pyproject.toml b/pyproject.toml index 09eb4d8d1..55fd3ec71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ['setuptools', 'wheel', 'pyarrow>=7,<16', 'pybind11', 'oldest-supported-numpy'] +requires = ['setuptools', 'wheel', 'pyarrow>=7,<16', 'pybind11', 'numpy>=2'] [tool.black] exclude = ''' diff --git a/setup.py b/setup.py index 170850e9b..db9e1ec72 100644 --- a/setup.py +++ b/setup.py @@ -259,7 +259,7 @@ def get_extension_modules(): setup( name="turbodbc", - version="4.13.0", + version="4.14.0", description="turbodbc is a Python DB API 2.0 compatible ODBC driver", long_description=long_description, long_description_content_type="text/markdown", @@ -271,10 +271,10 @@ def get_extension_modules(): setup_requires=[ "pybind11>=2.10.4", "pyarrow>=7,<18", - "numpy>=1.20,<2", + "numpy>=2", ], install_requires=[], - extras_require={"arrow": ["pyarrow>=7.0,<18"], "numpy": "numpy>=1.20.0,<2"}, + extras_require={"arrow": ["pyarrow>=7.0,<18"], "numpy": "numpy>=1.20.0"}, python_requires=">=3.10", classifiers=[ "Development Status :: 5 - Production/Stable", From 5327d6ef746fb926ee10423e2812f3c4a145d978 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Mon, 19 Aug 2024 11:17:43 +0200 Subject: [PATCH 2/3] Add more numpy search paths --- .gitignore | 3 +++ CMakeLists.txt | 2 +- cmake_scripts/Findnumpy.cmake | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 82005c2b7..be91abdc4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,6 @@ pybind11 PyTest/PyTest contrib/sdist +# pixi environments +.pixi +*.egg-info diff --git a/CMakeLists.txt b/CMakeLists.txt index 2544e5f65..053701597 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.10) project(turbodbc_intern CXX) # Take precedence over system modules diff --git a/cmake_scripts/Findnumpy.cmake b/cmake_scripts/Findnumpy.cmake index a926a892e..6df9add01 100644 --- a/cmake_scripts/Findnumpy.cmake +++ b/cmake_scripts/Findnumpy.cmake @@ -5,12 +5,16 @@ find_path( numpy/npy_common.h HINTS $ENV{VIRTUAL_ENV}/lib/*/site-packages/numpy/core/include + $ENV{VIRTUAL_ENV}/lib/*/site-packages/numpy/_core/include $ENV{CONDA_PREFIX}/lib/*/site-packages/numpy/core/include + $ENV{CONDA_PREFIX}/lib/*/site-packages/numpy/_core/include $ENV{CONDA_PREFIX}/Library/lib/*/site-packages/numpy/core/include + $ENV{CONDA_PREFIX}/Library/lib/*/site-packages/numpy/_core/include ENV PYTHON_INCLUDE_DIR /usr/local/lib/python2.7/dist-packages/numpy/core/include $ENV{PYTHON}/lib/site-packages/numpy/core/include $ENV{CONDA_PREFIX}/lib/site-packages/numpy/core/include + $ENV{CONDA_PREFIX}/lib/site-packages/numpy/_core/include DOC "Path to the numpy headers" ) From 30ab8a58d0cd8ac08cd1c6e81fa9785b62e5ac25 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Mon, 19 Aug 2024 11:21:47 +0200 Subject: [PATCH 3/3] Revert version bump --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 053701597..2544e5f65 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 2.8.12) project(turbodbc_intern CXX) # Take precedence over system modules