Skip to content

Commit 2c17837

Browse files
committed
bump MSRV to match PyO3
1 parent 8bfbb27 commit 2c17837

File tree

9 files changed

+20
-19
lines changed

9 files changed

+20
-19
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ jobs:
262262
with:
263263
python-version: "3.12"
264264
- name: Install Rust
265-
uses: dtolnay/rust-toolchain@1.63
265+
uses: dtolnay/rust-toolchain@1.74
266266
- uses: Swatinem/rust-cache@v2
267267
with:
268268
workspaces: examples/simple
@@ -273,8 +273,6 @@ jobs:
273273
run: |
274274
import toml
275275
cargo_toml = toml.load("Cargo.toml")
276-
cargo_toml["dependencies"]["ndarray"] = "0.15.6"
277-
cargo_toml["dependencies"]["once_cell"] = "1.20.3"
278276
with open("Cargo.toml", "w") as f:
279277
toml.dump(cargo_toml, f)
280278
working-directory: examples/simple
@@ -289,10 +287,6 @@ jobs:
289287
cargo_lock = toml.load("Cargo.lock")
290288
for pkg in cargo_lock["package"]:
291289
pkg_id = pkg["name"] + ":" + pkg["version"]
292-
if pkg["name"] == "ndarray" and pkg["version"] != "0.15.6":
293-
subprocess.run(["cargo", "update", "--package", pkg_id, "--precise", "0.15.6"], check=True)
294-
elif pkg["name"] == "once_cell" and pkg["version"] != "1.20.3":
295-
subprocess.run(["cargo", "update", "--package", pkg_id, "--precise", "1.20.3"], check=True)
296290
working-directory: examples/simple
297291
shell: python
298292
- name: Test example

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Changelog
2+
- v0.26.0
3+
- bump MSRV to 1.74, matching PyO3 ([#504](https://github.com/PyO3/rust-numpy/pull/504))
4+
5+
- v0.25.0,
6+
- Bump PyO3 dependency to v0.25.0. ([#492](https://github.com/PyO3/rust-numpy/pull/492))
7+
28
- v0.24.0
3-
- Bump PyO3 dependency to v0.24.0. ([#483](https://github.com/PyO3/rust-numpy/pull/483)
4-
- Support Python 3.13t "free-threaded" Python. ([#471](https://github.com/PyO3/rust-numpy/pull/471)
9+
- Bump PyO3 dependency to v0.24.0. ([#483](https://github.com/PyO3/rust-numpy/pull/483))
10+
- Support Python 3.13t "free-threaded" Python. ([#471](https://github.com/PyO3/rust-numpy/pull/471))
511

612
- v0.23.0
713
- Drop support for PyPy 3.7 and 3.8. ([#470](https://github.com/PyO3/rust-numpy/pull/470))

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ authors = [
88
description = "PyO3-based Rust bindings of the NumPy C-API"
99
documentation = "https://docs.rs/numpy"
1010
edition = "2021"
11-
rust-version = "1.63"
11+
rust-version = "1.74"
1212
repository = "https://github.com/PyO3/rust-numpy"
1313
categories = ["api-bindings", "development-tools::ffi", "science"]
1414
keywords = ["python", "numpy", "ffi", "pyo3"]

src/array.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@ pub trait PyArrayMethods<'py, T, D>: PyUntypedArrayMethods<'py> {
756756
/// or concurrently modified by Python or other native code.
757757
///
758758
/// Please consider the safe alternative [`PyReadwriteArray::as_slice_mut`].
759+
#[allow(clippy::mut_from_ref)]
759760
unsafe fn as_slice_mut(&self) -> Result<&mut [T], NotContiguousError>
760761
where
761762
T: Element,
@@ -821,6 +822,7 @@ pub trait PyArrayMethods<'py, T, D>: PyUntypedArrayMethods<'py> {
821822
/// assert_eq!(unsafe { *pyarray.get([1, 0, 3]).unwrap() }, 42);
822823
/// });
823824
/// ```
825+
#[allow(clippy::mut_from_ref)]
824826
unsafe fn get_mut(&self, index: impl NpyIndex<Dim = D>) -> Option<&mut T>
825827
where
826828
T: Element,

src/borrow/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ mod tests {
674674
let shared = array.readonly();
675675

676676
assert_eq!(
677-
format!("{:?}", shared),
677+
format!("{shared:?}"),
678678
"PyReadonlyArray<f64, ndarray::dimension::dim::Dim<[usize; 3]>>"
679679
);
680680
}
@@ -683,7 +683,7 @@ mod tests {
683683
let exclusive = array.readwrite();
684684

685685
assert_eq!(
686-
format!("{:?}", exclusive),
686+
format!("{exclusive:?}"),
687687
"PyReadwriteArray<f64, ndarray::dimension::dim::Dim<[usize; 3]>>"
688688
);
689689
}

src/borrow/shared.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,7 @@ fn insert_shared<'py>(py: Python<'py>) -> PyResult<*const Shared> {
151151
let version = unsafe { *capsule.pointer().cast::<u64>() };
152152
if version < 1 {
153153
return Err(PyTypeError::new_err(format!(
154-
"Version {} of borrow checking API is not supported by this version of rust-numpy",
155-
version
154+
"Version {version} of borrow checking API is not supported by this version of rust-numpy"
156155
)));
157156
}
158157

@@ -175,7 +174,7 @@ pub fn acquire<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<(), Bo
175174
match rc {
176175
0 => Ok(()),
177176
-1 => Err(BorrowError::AlreadyBorrowed),
178-
rc => panic!("Unexpected return code {} from borrow checking API", rc),
177+
rc => panic!("Unexpected return code {rc} from borrow checking API"),
179178
}
180179
}
181180

@@ -188,7 +187,7 @@ pub fn acquire_mut<'py>(py: Python<'py>, array: *mut PyArrayObject) -> Result<()
188187
0 => Ok(()),
189188
-1 => Err(BorrowError::AlreadyBorrowed),
190189
-2 => Err(BorrowError::NotWriteable),
191-
rc => panic!("Unexpected return code {} from borrow checking API", rc),
190+
rc => panic!("Unexpected return code {rc} from borrow checking API"),
192191
}
193192
}
194193

src/dtype.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ fn npy_int_type_lookup<T, T0, T1, T2>(npy_types: [NPY_TYPES; 3]) -> NPY_TYPES {
510510
x if x == size_of::<T0>() => npy_types[0],
511511
x if x == size_of::<T1>() => npy_types[1],
512512
x if x == size_of::<T2>() => npy_types[2],
513-
_ => panic!("Unable to match integer type descriptor: {:?}", npy_types),
513+
_ => panic!("Unable to match integer type descriptor: {npy_types:?}"),
514514
}
515515
}
516516

src/npyffi/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pub(crate) fn mod_name(py: Python<'_>) -> PyResult<&'static str> {
4646
MOD_NAME
4747
.get_or_try_init(py, || {
4848
let numpy_core = numpy_core_name(py)?;
49-
Ok(format!("{}.multiarray", numpy_core))
49+
Ok(format!("{numpy_core}.multiarray"))
5050
})
5151
.map(String::as_str)
5252
}

src/npyffi/ufunc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ fn mod_name(py: Python<'_>) -> PyResult<&'static str> {
1111
MOD_NAME
1212
.get_or_try_init(py, || {
1313
let numpy_core = super::array::numpy_core_name(py)?;
14-
Ok(format!("{}.umath", numpy_core))
14+
Ok(format!("{numpy_core}.umath"))
1515
})
1616
.map(String::as_str)
1717
}

0 commit comments

Comments
 (0)