Browse Source

Bump PyO3 to 0.25

Jelmer Vernooij 1 week ago
parent
commit
cf2a5e88c8
5 changed files with 28 additions and 26 deletions
  1. 12 19
      Cargo.lock
  2. 1 1
      Cargo.toml
  3. 2 0
      NEWS
  4. 2 2
      crates/diff-tree/src/lib.rs
  5. 11 4
      crates/objects/src/lib.rs

+ 12 - 19
Cargo.lock

@@ -8,12 +8,6 @@ version = "1.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26"
 
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
 [[package]]
 name = "diff-tree-py"
 version = "0.22.9"
@@ -93,11 +87,10 @@ dependencies = [
 
 [[package]]
 name = "pyo3"
-version = "0.23.5"
+version = "0.25.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7778bffd85cf38175ac1f545509665d0b9b92a198ca7941f131f85f7a4f9a872"
+checksum = "f239d656363bcee73afef85277f1b281e8ac6212a1d42aa90e55b90ed43c47a4"
 dependencies = [
- "cfg-if",
  "indoc",
  "libc",
  "memoffset",
@@ -111,9 +104,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3-build-config"
-version = "0.23.5"
+version = "0.25.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94f6cbe86ef3bf18998d9df6e0f3fc1050a8c5efa409bf712e661a4366e010fb"
+checksum = "755ea671a1c34044fa165247aaf6f419ca39caa6003aee791a0df2713d8f1b6d"
 dependencies = [
  "once_cell",
  "target-lexicon",
@@ -121,9 +114,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3-ffi"
-version = "0.23.5"
+version = "0.25.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9f1b4c431c0bb1c8fb0a338709859eed0d030ff6daa34368d3b152a63dfdd8d"
+checksum = "fc95a2e67091e44791d4ea300ff744be5293f394f1bafd9f78c080814d35956e"
 dependencies = [
  "libc",
  "pyo3-build-config",
@@ -131,9 +124,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3-macros"
-version = "0.23.5"
+version = "0.25.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fbc2201328f63c4710f68abdf653c89d8dbc2858b88c5d88b0ff38a75288a9da"
+checksum = "a179641d1b93920829a62f15e87c0ed791b6c8db2271ba0fd7c2686090510214"
 dependencies = [
  "proc-macro2",
  "pyo3-macros-backend",
@@ -143,9 +136,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3-macros-backend"
-version = "0.23.5"
+version = "0.25.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fca6726ad0f3da9c9de093d6f116a93c1a38e417ed73bf138472cf4064f72028"
+checksum = "9dff85ebcaab8c441b0e3f7ae40a6963ecea8a9f5e74f647e33fcf5ec9a1e89e"
 dependencies = [
  "heck",
  "proc-macro2",
@@ -176,9 +169,9 @@ dependencies = [
 
 [[package]]
 name = "target-lexicon"
-version = "0.12.16"
+version = "0.13.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
+checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a"
 
 [[package]]
 name = "unicode-ident"

+ 1 - 1
Cargo.toml

@@ -3,7 +3,7 @@ members = ["crates/*"]
 resolver = "2"
 
 [workspace.dependencies]
-pyo3 = "0.23"
+pyo3 = "0.25"
 
 [workspace.package]
 version = "0.22.9"

+ 2 - 0
NEWS

@@ -7,6 +7,8 @@
 
  * Fix wheels workflow. (Jelmer Vernooij)
 
+ * Bump PyO3 to 0.25. (Jelmer Vernooij)
+
 0.22.8	2025-03-02
 
  * Allow passing in plain strings to ``dulwich.porcelain.tag_create``

+ 2 - 2
crates/diff-tree/src/lib.rs

@@ -143,7 +143,7 @@ fn _merge_entries(
     let entries2 = tree_entries(path, tree2, py)?;
 
     let pym = py.import("dulwich.diff_tree")?;
-    let null_entry = pym.getattr("_NULL_ENTRY")?.to_object(py);
+    let null_entry = pym.getattr("_NULL_ENTRY")?.unbind();
 
     let mut result = Vec::new();
 
@@ -186,7 +186,7 @@ fn _merge_entries(
         i2 += 1;
     }
 
-    Ok(PyList::new(py, &result).unwrap().to_object(py))
+    Ok(PyList::new(py, &result).unwrap().unbind().into())
 }
 
 #[pymodule]

+ 11 - 4
crates/objects/src/lib.rs

@@ -78,7 +78,7 @@ fn parse_tree(
         text = &text[namelen + 1..];
         let sha = &text[..20];
         entries.push((
-            PyBytes::new(py, name).to_object(py),
+            PyBytes::new(py, name).into_pyobject(py)?.unbind().into(),
             mode,
             sha_to_pyhex(py, sha)?,
         ));
@@ -140,11 +140,18 @@ fn sorted_tree_items(
         .map(|(name, mode, hexsha)| -> PyResult<PyObject> {
             Ok(tree_entry_cls
                 .call1((
-                    PyBytes::new(py, name.as_slice()).to_object(py),
+                    PyBytes::new(py, name.as_slice())
+                        .into_pyobject(py)?
+                        .unbind()
+                        .into_any(),
                     mode,
-                    PyBytes::new(py, hexsha.as_slice()).to_object(py),
+                    PyBytes::new(py, hexsha.as_slice())
+                        .into_pyobject(py)?
+                        .unbind()
+                        .into_any(),
                 ))?
-                .to_object(py))
+                .unbind()
+                .into())
         })
         .collect::<PyResult<Vec<PyObject>>>()
 }