From 947b06e0ad6536034275994194549cee5a9c9091 Mon Sep 17 00:00:00 2001 From: Fabio Valentini Date: Mon, 10 Jul 2023 23:59:29 +0200 Subject: [PATCH] Update to version 0.19.1; Fixes RHBZ#2211444 --- .gitignore | 1 + ...with-missing-send_wrapper-dependency.patch | 25 ----------- ...with-missing-send_wrapper-dependency.patch | 43 +++++++++++++++++++ pyo3-fix-metadata.diff | 31 +++++++++---- rust-pyo3.spec | 27 ++++++++---- sources | 2 +- 6 files changed, 86 insertions(+), 43 deletions(-) delete mode 100644 0001-ignore-doctest-with-missing-send_wrapper-dependency.patch create mode 100644 0001-ignore-doctests-with-missing-send_wrapper-dependency.patch diff --git a/.gitignore b/.gitignore index 7152342..aedab92 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /pyo3-0.18.1.crate /pyo3-0.18.2.crate /pyo3-0.18.3.crate +/pyo3-0.19.1.crate diff --git a/0001-ignore-doctest-with-missing-send_wrapper-dependency.patch b/0001-ignore-doctest-with-missing-send_wrapper-dependency.patch deleted file mode 100644 index 04635bf..0000000 --- a/0001-ignore-doctest-with-missing-send_wrapper-dependency.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8728e54845a01940d060f0764adf96bb5eea6d01 Mon Sep 17 00:00:00 2001 -From: Fabio Valentini -Date: Tue, 17 Jan 2023 20:40:56 +0100 -Subject: [PATCH] ignore doctest with missing send_wrapper dependency - ---- - src/marker.rs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/marker.rs b/src/marker.rs -index f159d89..c4bc4af 100644 ---- a/src/marker.rs -+++ b/src/marker.rs -@@ -70,7 +70,7 @@ - //! This will "work" to smuggle Python references across the closure, because we're not actually - //! doing anything with threads: - //! --//! ```rust, no_run -+//! ```rust, ignore - //! use pyo3::prelude::*; - //! use pyo3::types::PyString; - //! use send_wrapper::SendWrapper; --- -2.39.0 - diff --git a/0001-ignore-doctests-with-missing-send_wrapper-dependency.patch b/0001-ignore-doctests-with-missing-send_wrapper-dependency.patch new file mode 100644 index 0000000..deb790a --- /dev/null +++ b/0001-ignore-doctests-with-missing-send_wrapper-dependency.patch @@ -0,0 +1,43 @@ +From 1a011b0266117687ff2b2d2de588064af964b968 Mon Sep 17 00:00:00 2001 +From: Fabio Valentini +Date: Wed, 5 Jul 2023 19:13:56 +0200 +Subject: [PATCH] ignore doctests with missing send_wrapper dependency + +--- + src/marker.rs | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/marker.rs b/src/marker.rs +index e5b3ed8..343bbb4 100644 +--- a/src/marker.rs ++++ b/src/marker.rs +@@ -66,7 +66,7 @@ + //! This will "work" to smuggle Python references across the closure, because we're not actually + //! doing anything with threads: + //! +-//! ```rust, no_run ++//! ```rust, ignore + //! use pyo3::prelude::*; + //! use pyo3::types::PyString; + //! use send_wrapper::SendWrapper; +@@ -158,7 +158,7 @@ use std::os::raw::c_int; + /// This also implies that the interplay between `with_gil` and `allow_threads` is unsound, for example + /// one can circumvent this protection using the [`send_wrapper`](https://docs.rs/send_wrapper/) crate: + /// +-/// ```no_run ++/// ```ignore + /// # use pyo3::prelude::*; + /// # use pyo3::types::PyString; + /// use send_wrapper::SendWrapper; +@@ -225,7 +225,7 @@ unsafe impl Ungil for T {} + /// On nightly Rust, this is not based on the [`Send`] auto trait and hence we are able + /// to prevent incorrectly circumventing it using e.g. the [`send_wrapper`](https://docs.rs/send_wrapper/) crate: + /// +-/// ```compile_fail ++/// ```ignore + /// # use pyo3::prelude::*; + /// # use pyo3::types::PyString; + /// use send_wrapper::SendWrapper; +-- +2.41.0 + diff --git a/pyo3-fix-metadata.diff b/pyo3-fix-metadata.diff index 2d57548..023cf11 100644 --- a/pyo3-fix-metadata.diff +++ b/pyo3-fix-metadata.diff @@ -1,9 +1,13 @@ ---- pyo3-0.18.3/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ pyo3-0.18.3/Cargo.toml 2023-05-06T20:19:17.578691+00:00 -@@ -57,52 +57,6 @@ +--- pyo3-0.19.1/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ pyo3-0.19.1/Cargo.toml 2023-07-05T16:57:19.970854+00:00 +@@ -61,65 +61,6 @@ "docsrs", ] +-[[bench]] +-name = "bench_any" +-harness = false +- -[[bench]] -name = "bench_call" -harness = false @@ -13,6 +17,11 @@ -harness = false - -[[bench]] +-name = "bench_decimal" +-harness = false +-required-features = ["rust_decimal"] +- +-[[bench]] -name = "bench_dict" -harness = false - @@ -49,11 +58,15 @@ -[[bench]] -name = "bench_intern" -harness = false +- +-[[bench]] +-name = "bench_extract" +-harness = false - [dependencies.anyhow] version = "1.0" optional = true -@@ -172,9 +126,6 @@ +@@ -194,9 +135,6 @@ [dev-dependencies.chrono] version = "0.4" @@ -63,7 +76,7 @@ [dev-dependencies.proptest] version = "0.10.1" -@@ -187,9 +138,6 @@ +@@ -213,9 +151,6 @@ [dev-dependencies.rustversion] version = "1.0" @@ -73,7 +86,7 @@ [dev-dependencies.serde] version = "1.0" features = ["derive"] -@@ -199,9 +147,6 @@ +@@ -225,9 +160,6 @@ [dev-dependencies.trybuild] version = ">=1.0.70" @@ -82,10 +95,10 @@ -version = "0.5.1" [build-dependencies.pyo3-build-config] - version = "0.18.3" -@@ -254,7 +199,6 @@ - "anyhow", + version = "0.19.1" +@@ -281,7 +213,6 @@ "experimental-inspect", + "rust_decimal", ] -generate-import-lib = ["pyo3-ffi/generate-import-lib"] macros = [ diff --git a/rust-pyo3.spec b/rust-pyo3.spec index 5dae3dc..bc6dac4 100644 --- a/rust-pyo3.spec +++ b/rust-pyo3.spec @@ -5,7 +5,7 @@ %global crate pyo3 Name: rust-pyo3 -Version: 0.18.3 +Version: 0.19.1 Release: %autorelease Summary: Bindings to Python interpreter @@ -19,7 +19,7 @@ Source: %{crates_source} # * drop MSVC- and MinGW-only features Patch: pyo3-fix-metadata.diff # * skip the single doctest that depends on send_wrapper -Patch: 0001-ignore-doctest-with-missing-send_wrapper-dependency.patch +Patch: 0001-ignore-doctests-with-missing-send_wrapper-dependency.patch BuildRequires: rust-packaging >= 21 @@ -335,6 +335,18 @@ use the "pyo3-macros" feature of the "%{crate}" crate. %files -n %{name}+pyo3-macros-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+rust_decimal-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+rust_decimal-devel %{_description} + +This package contains library source intended for building other packages which +use the "rust_decimal" feature of the "%{crate}" crate. + +%files -n %{name}+rust_decimal-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+serde-devel Summary: %{summary} BuildArch: noarch @@ -363,11 +375,8 @@ use the "unindent" feature of the "%{crate}" crate. %autosetup -n %{crate}-%{version_no_tilde} -p1 # drop files that are not useful rm -r emscripten/ newsfragments/ -# drop broken trybuild ui tests -rm tests/test_compile_error.rs # drop the tests for which dependencies were removed rm tests/test_pep_587.rs -rm tests/ui/send_wrapper.rs %cargo_prep %generate_buildrequires @@ -382,10 +391,12 @@ rm tests/ui/send_wrapper.rs %if %{with check} %check -# unit tests require an UTF-8 locale +# * unit tests require an UTF-8 locale +# * unit tests require the "auto-initialize" feature +# * skip a test that fails with Python 3.12: +# https://github.com/PyO3/pyo3/issues/3305 export LANG=C.utf8 -# unit tests require the "auto-initialize" feature -%cargo_test -f auto-initialize +%cargo_test -f auto-initialize -- -- --skip err::tests::fetching_panic_exception_resumes_unwind %endif %changelog diff --git a/sources b/sources index 48661ac..0f1792c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pyo3-0.18.3.crate) = 39f044a19a42a5e2f46049431fbe3fe10c14d12a4741cc789b42de7cbf448bcbded7fe38a0f124d994ff9bcd3d95a19305dbfdc7462331fda3e6686cc4289be5 +SHA512 (pyo3-0.19.1.crate) = b27500cf49f1c6f217d21344d24ac96c07b82c157dd36fa4550b94059da5715ba7d0e085ec07dd5f8a8ac9de4d7e9239c1cceac4337294eb0dc9f6102049d5ff