Skip to content

Commit

Permalink
Run numpy1 tests on windows too
Browse files Browse the repository at this point in the history
  • Loading branch information
maffoo committed Sep 30, 2024
1 parent d0e3667 commit 8d0f166
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,21 +87,31 @@ jobs:
RUST_BACKTRACE: 1

test-numpy1:
name: python${{ matrix.python-version }} numpy1
runs-on: ubuntu-latest
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }} numpy1
runs-on: ${{ matrix.platform.os }}
#needs: [lint, check-msrv, examples]
strategy:
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
#fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
python-version: ["3.10"]
platform: [
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
#{ 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" },
]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform.python-architecture }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform.rust-target }}
- name: Install toml
run: pip install toml
- name: Edit Cargo.toml and enable new resolver
Expand All @@ -115,13 +125,14 @@ jobs:
- name: Test
run: |
pip install "numpy<2" ml_dtypes
cargo test --all-features
cargo test --all-features --verbose -- --nocapture
- name: Test example
run: |
pip install nox
nox -f examples/simple/noxfile.py
env:
CARGO_TERM_VERBOSE: true
CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }}
RUST_BACKTRACE: 1

# cross-build:
Expand Down
4 changes: 3 additions & 1 deletion src/borrow/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use rustc_hash::FxHashMap;
use crate::array::get_array_module;
use crate::cold;
use crate::error::BorrowError;
use crate::npyffi::{PyArrayObject, PyArray_Check, PyDataType_ISLEGACY, PyDataType_ELSIZE, NPY_ARRAY_WRITEABLE};
use crate::npyffi::{PyArrayObject, PyArray_Check, PyDataType_ISLEGACY, PyDataType_ELSIZE, NPY_ARRAY_WRITEABLE, PY_ARRAY_API};

/// Defines the shared C API used for borrow checking
///
Expand Down Expand Up @@ -408,6 +408,8 @@ fn data_range<'py>(py: Python<'py>, array: *mut PyArrayObject) -> (*mut c_char,

let itemsize = unsafe { PyDataType_ELSIZE(py, (*array).descr) } as isize;
println!("itemsize = {itemsize}");
println!("c version = {:x}", unsafe { PY_ARRAY_API.PyArray_GetNDArrayCVersion(py) });
println!("c feature version = {:x}", unsafe { PY_ARRAY_API.PyArray_GetNDArrayCFeatureVersion(py) });

let mut start = 0;
let mut end = 0;
Expand Down

0 comments on commit 8d0f166

Please sign in to comment.