From 8e5ef9058b576f72909311238e058dc025ec8668 Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Sun, 26 Nov 2023 10:00:08 +0000 Subject: [PATCH 1/3] ci: run beta clippy as an allowed-to-fail job --- .github/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89368fa0..7aec7b92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,17 @@ jobs: rust-target: "i686-pc-windows-msvc", }, ] + include: + # Run beta clippy as a way to detect any incoming lints which may affect downstream users + - rust: beta + platform: + { + os: "ubuntu-latest", + python-architecture: "x64", + rust-target: "x86_64-unknown-linux-gnu", + } name: clippy/${{ matrix.platform.rust-target }}/${{ matrix.rust }} + continue-on-error: ${{ matrix.platform.rust != 'stable' }} steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master From 41842f9e4bb837664c893f44b4268ae53f9577aa Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Sun, 26 Nov 2023 10:23:39 +0000 Subject: [PATCH 2/3] fix pyo3-ffi beta clippy warnings --- pyo3-ffi/src/cpython/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyo3-ffi/src/cpython/mod.rs b/pyo3-ffi/src/cpython/mod.rs index efb93eff..738ba376 100644 --- a/pyo3-ffi/src/cpython/mod.rs +++ b/pyo3-ffi/src/cpython/mod.rs @@ -31,7 +31,6 @@ pub(crate) mod pystate; pub(crate) mod pythonrun; // skipped sysmodule.h pub(crate) mod floatobject; -#[cfg(not(PyPy))] pub(crate) mod pyframe; pub(crate) mod tupleobject; pub(crate) mod unicodeobject; @@ -60,7 +59,7 @@ pub use self::object::*; pub use self::objimpl::*; pub use self::pydebug::*; pub use self::pyerrors::*; -#[cfg(not(PyPy))] +#[cfg(Py_3_11)] pub use self::pyframe::*; #[cfg(all(Py_3_8, not(PyPy)))] pub use self::pylifecycle::*; @@ -69,4 +68,5 @@ pub use self::pystate::*; pub use self::pythonrun::*; pub use self::tupleobject::*; pub use self::unicodeobject::*; +#[cfg(not(PyPy))] pub use self::weakrefobject::*; From cf67c2ce469224f4bba4076bede2d914563650bb Mon Sep 17 00:00:00 2001 From: David Hewitt Date: Sun, 26 Nov 2023 10:26:21 +0000 Subject: [PATCH 3/3] fix test-serde beta clippy warning --- tests/test_serde.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_serde.rs b/tests/test_serde.rs index f9c96598..f1d5bee4 100644 --- a/tests/test_serde.rs +++ b/tests/test_serde.rs @@ -66,7 +66,7 @@ mod test_serde { assert_eq!(user.username, "danya"); assert!(user.group.is_none()); assert_eq!(user.friends.len(), 1usize); - let friend = user.friends.get(0).unwrap(); + let friend = user.friends.first().unwrap(); Python::with_gil(|py| { assert_eq!(friend.borrow(py).username, "friend");