Skip to content

Commit

Permalink
Update tensorstore build to be compatible with numpy2
Browse files Browse the repository at this point in the history
This requires:
numpy>=2.0.0rc1

Fixes: #165
PiperOrigin-RevId: 642315379
Change-Id: Ie3fc8975929b0ba3bd3d996729b6e885dfcb9cf5
  • Loading branch information
laramiel authored and Copybara-Service committed Jun 11, 2024
1 parent ad54e54 commit 3c9b9c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ requires = [
"setuptools>=30.3.0",
"wheel",
"setuptools_scm",
"numpy>=1.22.0",
"numpy>=2.0.0rc2",
]
4 changes: 4 additions & 0 deletions python/tensorstore/numpy.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
#error "Numpy cannot be included before numpy.h."
#endif

// Require NumPy >= 1.22 for NPY_ARRAY_ENSURENOCOPY.
// https://numpy.org/devdocs/dev/depending_on_numpy.html#build-time-dependency
#define NPY_TARGET_VERSION NPY_1_22_API_VERSION

// Disallow Numpy 1.7 deprecated symbols.
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION

Expand Down
2 changes: 1 addition & 1 deletion tools/ci/build_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-r ../../third_party/pypa/wheel_requirements_frozen.txt
numpy>=1.22.0
numpy>=2.0.0rc2

0 comments on commit 3c9b9c0

Please sign in to comment.