Skip to content

Commit

Permalink
Merge pull request #432 from blue-yonder/numpy2
Browse files Browse the repository at this point in the history
Support numpy>=2
  • Loading branch information
xhochy authored Aug 19, 2024
2 parents 6c0f054 + 30ab8a5 commit 1b68d19
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 29 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ pybind11

PyTest/PyTest
contrib/sdist
# pixi environments
.pixi
*.egg-info
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------
Expand Down
48 changes: 24 additions & 24 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -226,15 +226,15 @@ 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

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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -334,15 +334,15 @@ 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

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

Expand Down
4 changes: 4 additions & 0 deletions cmake_scripts/Findnumpy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ dependencies:
- pkg-config
- ninja
- pytest
- numpy<2
- numpy>=1.20
- pybind11
- simdutf
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = '''
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 1b68d19

Please sign in to comment.