Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI to make it compatible with outside changes (NumPy 2.x, macOS 14) #436

Merged
merged 3 commits into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ jobs:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
platform: [
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
{ os: "macOS-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "macOS-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
{ os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" },
]
include:
# Older versions of CPython are not available for AArch64.
- python-version: 3.12
platform: { os: "macOS-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
# NumPy does not provide pre-built wheels for PyPy on macOS and Windows
- python-version: pypy-3.7
platform: { os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" }
Expand Down Expand Up @@ -67,7 +70,7 @@ jobs:
shell: python
- name: Test
run: |
pip install numpy ml_dtypes
pip install "numpy<2" ml_dtypes
cargo test --all-features
# Not on PyPy, because no embedding API
if: ${{ !startsWith(matrix.python-version, 'pypy') }}
Expand Down Expand Up @@ -101,7 +104,7 @@ jobs:
continue-on-error: true
- uses: taiki-e/install-action@valgrind
- run: |
pip install numpy ml_dtypes
pip install "numpy<2" ml_dtypes
cargo test --all-features --release
env:
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUNNER: valgrind --leak-check=no --error-exitcode=1
Expand All @@ -116,7 +119,7 @@ jobs:
continue-on-error: true
- uses: taiki-e/install-action@cargo-careful
- run: |
pip install numpy ml_dtypes
pip install "numpy<2" ml_dtypes
cargo careful test --all-features

check-msrv:
Expand Down Expand Up @@ -192,7 +195,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Install numpy
run: pip install numpy ml_dtypes
run: pip install "numpy<2" ml_dtypes
- uses: Swatinem/rust-cache@v2
continue-on-error: true
- uses: dtolnay/rust-toolchain@stable
Expand Down
2 changes: 1 addition & 1 deletion examples/linalg/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

@nox.session
def tests(session):
session.install("pip", "numpy", "pytest")
session.install("pip", "numpy<2", "pytest")
session.run("pip", "install", ".", "-v")
session.run("pytest")
2 changes: 1 addition & 1 deletion examples/parallel/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

@nox.session
def tests(session):
session.install("pip", "numpy", "pytest")
session.install("pip", "numpy<2", "pytest")
session.run("pip", "install", ".", "-v")
session.run("pytest")
2 changes: 1 addition & 1 deletion examples/simple/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

@nox.session
def tests(session):
session.install("pip", "numpy", "pytest")
session.install("pip", "numpy<2", "pytest")
session.run("pip", "install", ".", "-v")
session.run("pytest")
4 changes: 2 additions & 2 deletions src/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use crate::untyped_array::{PyUntypedArray, PyUntypedArrayMethods};
/// # Memory location
///
/// - Allocated by Rust: Constructed via [`IntoPyArray`] or
/// [`from_vec`][Self::from_vec] or [`from_owned_array`][Self::from_owned_array].
/// [`from_vec`][Self::from_vec] or [`from_owned_array`][Self::from_owned_array].
///
/// These methods transfers ownership of the Rust allocation into a suitable Python object
/// and uses the memory as the internal buffer backing the NumPy array.
Expand All @@ -49,7 +49,7 @@ use crate::untyped_array::{PyUntypedArray, PyUntypedArrayMethods};
/// when used with this kind of array as NumPy cannot reallocate the internal buffer.
///
/// - Allocated by NumPy: Constructed via other methods, like [`ToPyArray`] or
/// [`from_slice`][Self::from_slice] or [`from_array`][Self::from_array].
/// [`from_slice`][Self::from_slice] or [`from_array`][Self::from_array].
///
/// These methods allocate memory in Python's private heap via NumPy's API.
///
Expand Down