diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 04c9e9f5..e9cc053e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -140,7 +140,7 @@ jobs: LDFLAGS: "-O2 -flto=thin -fuse-ld=lld -Wl,--as-needed" RUSTFLAGS: "-C linker=clang" CARGO_UNSTABLE_SPARSE_REGISTRY: "true" - run: PATH=$HOME/.cargo/bin:$PATH PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") maturin build --release --strip --features=unstable-simd --universal2 + run: PATH=$HOME/.cargo/bin:$PATH PYO3_CROSS_LIB_DIR=$(python -c "import sysconfig;print(sysconfig.get_config_var('LIBDIR'))") maturin build --release --strip --features=unstable-simd --target universal2-apple-darwin - if: startsWith(github.ref, 'refs/tags') run: twine upload --non-interactive --skip-existing target/wheels/* release_sdist: diff --git a/Cargo.lock b/Cargo.lock index e7a4640c..9c2eebc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,9 +36,6 @@ name = "bytecount" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" -dependencies = [ - "packed_simd_2", -] [[package]] name = "byteorder" @@ -54,12 +51,12 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", - "packed_simd_2", + "packed_simd", ] [[package]] @@ -93,9 +90,9 @@ checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libm" -version = "0.1.4" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "lock_api" @@ -123,6 +120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -153,13 +151,13 @@ dependencies = [ ] [[package]] -name = "packed_simd_2" -version = "0.3.8" +name = "packed_simd" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1914cd452d8fccd6f9db48147b29fd4ae05bea9dc5d9ad578509f72415de282" +checksum = "1f9f08af0c877571712e2e3e686ad79efad9657dbf0f7c3c8ba943ff6c38932d" dependencies = [ "cfg-if", - "libm", + "num-traits", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 95298d39..6f18d93a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,6 @@ default = ["unstable-simd"] # Use SIMD intrinsics. This requires Rust on the nightly channel. unstable-simd = [ - "bytecount/generic-simd", "bytecount/runtime-dispatch-simd", "encoding_rs/simd-accel", "simdutf8/aarch64_neon", diff --git a/src/serialize/default.rs b/src/serialize/default.rs index 49a374b5..d7266b38 100644 --- a/src/serialize/default.rs +++ b/src/serialize/default.rs @@ -52,6 +52,7 @@ impl Serialize for DefaultSerializer { if unlikely!(self.default_calls == RECURSION_LIMIT) { err!("default serializer exceeds recursion limit") } + #[allow(clippy::unnecessary_cast)] let default_obj = ffi!(PyObject_CallFunctionObjArgs( callable.as_ptr(), self.ptr, diff --git a/src/serialize/writer.rs b/src/serialize/writer.rs index 80218fa2..5673abcf 100644 --- a/src/serialize/writer.rs +++ b/src/serialize/writer.rs @@ -48,7 +48,7 @@ impl BytesWriter { self.cap = len; unsafe { _PyBytes_Resize( - std::ptr::addr_of_mut!(self.bytes) as *mut *mut PyBytesObject as *mut *mut PyObject, + std::ptr::addr_of_mut!(self.bytes) as *mut *mut PyObject, len as isize, ); } @@ -82,7 +82,7 @@ impl std::io::Write for BytesWriter { self.grow(end_length); } unsafe { - std::ptr::copy_nonoverlapping(buf.as_ptr() as *const u8, self.buffer_ptr(), to_write); + std::ptr::copy_nonoverlapping(buf.as_ptr(), self.buffer_ptr(), to_write); }; self.len = end_length; Ok(()) @@ -174,7 +174,7 @@ impl WriteExt for &mut BytesWriter { unsafe { let ptr = self.buffer_ptr(); std::ptr::write(ptr, b'"'); - std::ptr::copy_nonoverlapping(val.as_ptr() as *const u8, ptr.add(1), to_write); + std::ptr::copy_nonoverlapping(val.as_ptr(), ptr.add(1), to_write); std::ptr::write(ptr.add(to_write + 1), b'"'); }; self.len = end_length; @@ -187,7 +187,7 @@ impl WriteExt for &mut BytesWriter { ) -> std::result::Result<(), std::io::Error> { let to_write = val.len(); unsafe { - std::ptr::copy_nonoverlapping(val.as_ptr() as *const u8, self.buffer_ptr(), to_write); + std::ptr::copy_nonoverlapping(val.as_ptr(), self.buffer_ptr(), to_write); }; self.len += to_write; Ok(()) diff --git a/tests/requirements.txt b/tests/requirements.txt index c1351112..c73bb86d 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -8,4 +8,4 @@ pytz typing_extensions;python_version>="3.6" and python_version<"3.8" xxhash==1.4.3;sys_platform!="windows" and python_version<"3.9" # creates non-compact ASCII for test_str_ascii msgpack -pydantic +pydantic==1.10.12