Skip to content

Commit

Permalink
build(python): Add support for NumPy 2.0 (#17384)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego authored Jul 3, 2024
1 parent d13efa5 commit 276655a
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ seaborn
plotly
altair
numba
# Unpin NumPy when support is implemented in numpy crate:
# https://github.com/pola-rs/polars/issues/16998
numpy<2
numpy

mkdocs-material==9.5.27
mkdocs-macros-plugin==1.0.5
Expand Down
4 changes: 3 additions & 1 deletion py-polars/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ itoa = { workspace = true }
libc = "0.2"
ndarray = { workspace = true }
num-traits = { workspace = true }
numpy = { version = "0.21", default-features = false }
# TODO: Pin to released version once NumPy 2.0 support is merged
# https://github.com/PyO3/rust-numpy/issues/409
numpy = { git = "https://github.com/stinodego/rust-numpy.git", rev = "9ba9962ae57ba26e35babdce6f179edf5fe5b9c8", default-features = false }
once_cell = { workspace = true }
pyo3 = { workspace = true, features = ["abi3-py38", "chrono", "extension-module", "multiple-pymethods"] }
recursive = { workspace = true }
Expand Down
4 changes: 1 addition & 3 deletions py-polars/docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
hypothesis
# Unpin NumPy when support is implemented in numpy crate:
# https://github.com/pola-rs/polars/issues/16998
numpy<2
numpy
pandas
pyarrow

Expand Down
2 changes: 1 addition & 1 deletion py-polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Changelog = "https://github.com/pola-rs/polars/releases"
# Interop
# TODO: Remove NumPy upper bound once we support NumPy 2.0.0
# https://github.com/pola-rs/polars/issues/16998
numpy = ["numpy >= 1.16.0, < 2.0.0"]
numpy = ["numpy >= 1.16.0"]
pandas = ["pandas", "polars[pyarrow]"]
pyarrow = ["pyarrow >= 7.0.0"]
pydantic = ["pydantic"]
Expand Down
4 changes: 1 addition & 3 deletions py-polars/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ pip
# ------------

# Interop
# Unpin NumPy when support is implemented in numpy crate:
# https://github.com/pola-rs/polars/issues/16998
numpy<2
numpy
numba; python_version < '3.13' # Numba can lag Python releases
pandas
pyarrow
Expand Down

0 comments on commit 276655a

Please sign in to comment.