Skip to content

Commit 9843838

Browse files
committed
chore(deps): bump pyo3 0.24->0.29 + migrate API (allow_threads->detach)
Lands dependabot PR #57 directly on main: the Forgejo->GitHub mirror reverts maintainer pushes to dependabot branches, so the API migration (Python::detach, #[pyclass(skip_from_py_object)] on Clone output types) is applied here instead. pyo3 0.29 also closes two RustSec advisories (cargo audit now clean). Closes #57
1 parent d819a2b commit 9843838

3 files changed

Lines changed: 17 additions & 59 deletions

File tree

diffctx/Cargo.lock

Lines changed: 10 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

diffctx/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ glob = "0.3"
121121
smallvec = "1"
122122
walkdir = "2"
123123
wait-timeout = "0.2"
124-
pyo3 = { version = "0.24", features = ["extension-module", "abi3-py310"], optional = true }
124+
pyo3 = { version = "0.29", features = ["extension-module", "abi3-py310"], optional = true }
125125

126126
[dev-dependencies]
127127
tempfile = "3"

diffctx/src/pybridge.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn map_pipeline_err(e: anyhow::Error) -> PyErr {
2727
pyo3::exceptions::PyRuntimeError::new_err(e.to_string())
2828
}
2929

30-
#[pyclass]
30+
#[pyclass(skip_from_py_object)]
3131
#[derive(Clone)]
3232
pub struct PyFragment {
3333
#[pyo3(get)]
@@ -82,7 +82,7 @@ impl From<&FragmentEntry> for PyFragment {
8282
}
8383
}
8484

85-
#[pyclass]
85+
#[pyclass(skip_from_py_object)]
8686
#[derive(Clone)]
8787
pub struct DiffContextResult {
8888
#[pyo3(get)]
@@ -258,7 +258,7 @@ fn build_diff_context<'py>(
258258

259259
let start = std::time::Instant::now();
260260
let output = py
261-
.allow_threads(|| {
261+
.detach(|| {
262262
pipeline::build_diff_context(
263263
path,
264264
range,
@@ -350,7 +350,7 @@ fn compute_scored_state(
350350
Some(diff_range)
351351
};
352352
let state = py
353-
.allow_threads(|| pipeline::compute_scored_state(path, range, alpha, mode, timeout))
353+
.detach(|| pipeline::compute_scored_state(path, range, alpha, mode, timeout))
354354
.map_err(map_pipeline_err)?;
355355
Ok(PyScoredState {
356356
inner: Arc::new(state),
@@ -372,7 +372,7 @@ fn select_with_params<'py>(
372372
no_content: bool,
373373
) -> PyResult<Bound<'py, PyDict>> {
374374
let inner = state.inner.clone();
375-
let output = py.allow_threads(move || {
375+
let output = py.detach(move || {
376376
if inner.all_fragments.is_empty() {
377377
return DiffContextOutput {
378378
name: inner
@@ -515,7 +515,7 @@ impl PyQuotientGraph {
515515
}
516516
}
517517

518-
#[pyclass]
518+
#[pyclass(skip_from_py_object)]
519519
#[derive(Clone)]
520520
pub struct PyModuleMetrics {
521521
#[pyo3(get)]

0 commit comments

Comments
 (0)