diff --git a/.gitignore b/.gitignore index f3a3a7a..4a899b9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ /pyo3-0.14.5.crate /pyo3-0.15.1.crate /pyo3-0.15.2.crate +/pyo3-0.16.6.crate diff --git a/.rust2rpm.conf b/.rust2rpm.conf deleted file mode 100644 index 78cd02f..0000000 --- a/.rust2rpm.conf +++ /dev/null @@ -1,13 +0,0 @@ -[DEFAULT] -buildrequires = - python3-devel >= 3.6 -lib+default.requires = - python3-devel >= 3.6 -lib+abi3-py36.requires = - python3-devel >= 3.6 -lib+abi3-py37.requires = - python3-devel >= 3.7 -lib+abi3-py38.requires = - python3-devel >= 3.8 -lib+abi3-py39.requires = - python3-devel >= 3.9 diff --git a/0001-ignore-doctest-with-missing-send_wrapper-dependency.patch b/0001-ignore-doctest-with-missing-send_wrapper-dependency.patch new file mode 100644 index 0000000..04635bf --- /dev/null +++ b/0001-ignore-doctest-with-missing-send_wrapper-dependency.patch @@ -0,0 +1,25 @@ +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/pyo3-fix-metadata.diff b/pyo3-fix-metadata.diff index 93d10f6..f97b9da 100644 --- a/pyo3-fix-metadata.diff +++ b/pyo3-fix-metadata.diff @@ -1,6 +1,6 @@ ---- pyo3-0.15.2/Cargo.toml 1970-01-01T00:00:01+00:00 -+++ pyo3-0.15.2/Cargo.toml 2022-05-05T09:14:10.358610+00:00 -@@ -57,42 +57,6 @@ +--- pyo3-0.16.6/Cargo.toml 1970-01-01T00:00:01+00:00 ++++ pyo3-0.16.6/Cargo.toml 2023-01-17T19:53:56.296203+00:00 +@@ -56,52 +56,6 @@ "docsrs", ] @@ -17,6 +17,11 @@ -harness = false - -[[bench]] +-name = "bench_frompyobject" +-harness = false +-required-features = ["macros"] +- +-[[bench]] -name = "bench_gil" -harness = false - @@ -27,6 +32,7 @@ -[[bench]] -name = "bench_pyclass" -harness = false +-required-features = ["macros"] - -[[bench]] -name = "bench_pyobject" @@ -39,11 +45,15 @@ -[[bench]] -name = "bench_tuple" -harness = false +- +-[[bench]] +-name = "bench_intern" +-harness = false - [dependencies.anyhow] version = "1.0" optional = true -@@ -109,11 +73,11 @@ +@@ -118,7 +72,7 @@ optional = true [dependencies.indexmap] @@ -52,37 +62,42 @@ optional = true [dependencies.indoc] --version = "0.3.6" -+version = "1.0.3" - optional = true - - [dependencies.inventory] -@@ -135,7 +99,7 @@ - version = "0.11.0" - - [dependencies.paste] --version = "0.1.18" -+version = "1.0" - optional = true - - [dependencies.pyo3-macros] -@@ -154,16 +118,13 @@ +@@ -161,9 +115,6 @@ + [dev-dependencies.assert_approx_eq] version = "1.1.0" - [dev-dependencies.bitflags] --version = "=1.2.1" -+version = "1.2.1" +-[dev-dependencies.criterion] +-version = "0.3.5" +- + [dev-dependencies.proptest] + version = "0.10.1" + features = ["std"] +@@ -171,9 +122,6 @@ - [dev-dependencies.clap] --version = "=2.33" + [dev-dependencies.rustversion] + version = "1.0" - --[dev-dependencies.criterion] --version = "=0.3.4" -+version = "2.33" +-[dev-dependencies.send_wrapper] +-version = "0.5" - [dev-dependencies.half] --version = "=1.7.1" -+version = "1.7.1" + [dev-dependencies.serde] + version = "1.0" +@@ -184,9 +132,6 @@ - [dev-dependencies.proptest] - version = "0.10.1" + [dev-dependencies.trybuild] + version = "1.0.49" +- +-[dev-dependencies.widestring] +-version = "0.5.1" + + [build-dependencies.pyo3-build-config] + version = "0.16.6" +@@ -236,8 +181,6 @@ + "eyre", + "anyhow", + ] +-generate-abi3-import-lib = ["generate-import-lib"] +-generate-import-lib = ["pyo3-ffi/generate-import-lib"] + macros = [ + "pyo3-macros", + "indoc", diff --git a/rust-pyo3.spec b/rust-pyo3.spec index a11af30..d18e09c 100644 --- a/rust-pyo3.spec +++ b/rust-pyo3.spec @@ -1,29 +1,26 @@ -# Generated by rust2rpm 21 +# Generated by rust2rpm 23 %bcond_without check %global debug_package %{nil} %global crate pyo3 -Name: rust-%{crate} -Version: 0.15.2 +Name: rust-pyo3 +Version: 0.16.6 Release: %autorelease Summary: Bindings to Python interpreter -# Upstream license specification: Apache-2.0 -License: ASL 2.0 +License: Apache-2.0 URL: https://crates.io/crates/pyo3 Source: %{crates_source} -# Initial patched metadata -# * bump dependencies (MSRV 1.41 is not relevant for Fedora): -# - bump indoc from 0.3.6 to 1.0.3 -# - bump paste from 0.1.18 to 1.0 -# * relax exact versions for optional indexmap dependency -# * relax exact versions for bitflags, clap, and half dev-dependencies +# Manually created patch for downstream crate metadata changes +# * relax indexmap dependency to allow versions ^1.8 # * drop unused, benchmark-only criterion dev-dependency to speed up builds # * drop unused benchmark definitions from Cargo.toml -Patch0: pyo3-fix-metadata.diff - -ExclusiveArch: %{rust_arches} +# * drop send_wrapper and widestring dev-dependencies (not packaged yet) +# * 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 BuildRequires: rust-packaging >= 21 @@ -43,14 +40,16 @@ use the "%{crate}" crate. %files devel %license %{crate_instdir}/LICENSE +%doc %{crate_instdir}/Architecture.md %doc %{crate_instdir}/CHANGELOG.md +%doc %{crate_instdir}/Code-of-Conduct.md +%doc %{crate_instdir}/Contributing.md %doc %{crate_instdir}/README.md %{crate_instdir}/ %package -n %{name}+default-devel Summary: %{summary} BuildArch: noarch -Requires: python3-devel >= 3.6 %description -n %{name}+default-devel %{_description} @@ -84,23 +83,9 @@ use the "abi3-py310" feature of the "%{crate}" crate. %files -n %{name}+abi3-py310-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+abi3-py36-devel -Summary: %{summary} -BuildArch: noarch -Requires: python3-devel >= 3.6 - -%description -n %{name}+abi3-py36-devel %{_description} - -This package contains library source intended for building other packages which -use the "abi3-py36" feature of the "%{crate}" crate. - -%files -n %{name}+abi3-py36-devel -%ghost %{crate_instdir}/Cargo.toml - %package -n %{name}+abi3-py37-devel Summary: %{summary} BuildArch: noarch -Requires: python3-devel >= 3.7 %description -n %{name}+abi3-py37-devel %{_description} @@ -113,7 +98,6 @@ use the "abi3-py37" feature of the "%{crate}" crate. %package -n %{name}+abi3-py38-devel Summary: %{summary} BuildArch: noarch -Requires: python3-devel >= 3.8 %description -n %{name}+abi3-py38-devel %{_description} @@ -126,7 +110,6 @@ use the "abi3-py38" feature of the "%{crate}" crate. %package -n %{name}+abi3-py39-devel Summary: %{summary} BuildArch: noarch -Requires: python3-devel >= 3.9 %description -n %{name}+abi3-py39-devel %{_description} @@ -184,6 +167,18 @@ use the "eyre" feature of the "%{crate}" crate. %files -n %{name}+eyre-devel %ghost %{crate_instdir}/Cargo.toml +%package -n %{name}+full-devel +Summary: %{summary} +BuildArch: noarch + +%description -n %{name}+full-devel %{_description} + +This package contains library source intended for building other packages which +use the "full" feature of the "%{crate}" crate. + +%files -n %{name}+full-devel +%ghost %{crate_instdir}/Cargo.toml + %package -n %{name}+hashbrown-devel Summary: %{summary} BuildArch: noarch @@ -292,28 +287,28 @@ use the "num-complex" feature of the "%{crate}" crate. %files -n %{name}+num-complex-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+paste-devel +%package -n %{name}+pyo3-macros-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+paste-devel %{_description} +%description -n %{name}+pyo3-macros-devel %{_description} This package contains library source intended for building other packages which -use the "paste" feature of the "%{crate}" crate. +use the "pyo3-macros" feature of the "%{crate}" crate. -%files -n %{name}+paste-devel +%files -n %{name}+pyo3-macros-devel %ghost %{crate_instdir}/Cargo.toml -%package -n %{name}+pyo3-macros-devel +%package -n %{name}+pyproto-devel Summary: %{summary} BuildArch: noarch -%description -n %{name}+pyo3-macros-devel %{_description} +%description -n %{name}+pyproto-devel %{_description} This package contains library source intended for building other packages which -use the "pyo3-macros" feature of the "%{crate}" crate. +use the "pyproto" feature of the "%{crate}" crate. -%files -n %{name}+pyo3-macros-devel +%files -n %{name}+pyproto-devel %ghost %{crate_instdir}/Cargo.toml %package -n %{name}+serde-devel @@ -344,12 +339,14 @@ use the "unindent" feature of the "%{crate}" crate. %autosetup -n %{crate}-%{version_no_tilde} -p1 # 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 # unit tests require optional dependencies %cargo_generate_buildrequires -a -echo 'python3-devel >= 3.6' %build %cargo_build diff --git a/sources b/sources index 012d493..9176688 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pyo3-0.15.2.crate) = 81595bf2b5d2b3a4e79750f0779c142fe7c3e7185f9ffa68a83fce30062ae6812d7af71bee425206552c95839ad7473408f658ff936d4a1f58fd1ac922822582 +SHA512 (pyo3-0.16.6.crate) = fe297e4d171ecb5a965ce9f3a0527a086766ac5607ba7b59b2a3a8f6cc66da3959d93f1d6aa688d67ceebde41ac4adefce18c0d52c1b77d0cd95cf1178f52325