Skip to content

Commit e9dff15

Browse files
sd2kclaude
andauthored
chore(pyaugurs): upgrade to pyo3 0.27 (#432)
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent f62818f commit e9dff15

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.github/workflows/python.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
4848
with:
4949
target: ${{ matrix.platform.target }}
50-
args: --release --out dist -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i pypy-3.9 -i pypy-3.10 --manifest-path crates/pyaugurs/Cargo.toml
50+
args: --release --out dist -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i pypy-3.11 --manifest-path crates/pyaugurs/Cargo.toml
5151
manylinux: auto
5252
- name: Upload wheels
5353
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
@@ -79,7 +79,7 @@ jobs:
7979
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
8080
with:
8181
target: ${{ matrix.platform.target }}
82-
args: --release --out dist -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i pypy-3.9 -i pypy-3.10 --manifest-path crates/pyaugurs/Cargo.toml
82+
args: --release --out dist -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i pypy-3.11 --manifest-path crates/pyaugurs/Cargo.toml
8383
manylinux: musllinux_1_2
8484
- name: Upload wheels
8585
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
@@ -95,10 +95,10 @@ jobs:
9595
platform:
9696
- runner: windows-2022
9797
target: x64
98-
interpreters: -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i 3.14
98+
interpreters: -i 3.11 -i 3.12 -i 3.13 -i 3.14
9999
- runner: windows-2022
100100
target: x86
101-
interpreters: -i 3.10 -i 3.11 -i 3.12 -i 3.13
101+
interpreters: -i 3.11 -i 3.12 -i 3.13
102102
steps:
103103
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
104104
with:
@@ -138,7 +138,7 @@ jobs:
138138
uses: PyO3/maturin-action@b1bd829e37fef14c63f19162034228a2f3dc1021 # v1.50.0
139139
with:
140140
target: ${{ matrix.platform.target }}
141-
args: --release --out dist -i 3.10 -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i pypy-3.9 -i pypy-3.10 --manifest-path crates/pyaugurs/Cargo.toml
141+
args: --release --out dist -i 3.11 -i 3.12 -i 3.13 -i 3.14 -i pypy-3.11 --manifest-path crates/pyaugurs/Cargo.toml
142142
- name: Upload wheels
143143
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
144144
with:

crates/pyaugurs/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ augurs-ets = { workspace = true, features = ["mstl"] }
2626
augurs-forecaster.workspace = true
2727
augurs-mstl.workspace = true
2828
augurs-seasons.workspace = true
29-
numpy = "0.26.0"
30-
pyo3 = { version = "0.26.0", features = ["extension-module"] }
29+
numpy = "0.27.0"
30+
pyo3 = { version = "0.27.0", features = ["extension-module"] }
3131
tracing = { version = "0.1.37", features = ["log"] }
3232

3333
[lints]

crates/pyaugurs/src/trend.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ impl FittedTrendModel for PyFittedTrendModel {
9696
.model
9797
.call_method1(py, "predict", (horizon, level))
9898
.map_err(|e| Box::new(PyException::new_err(format!("error predicting: {e}"))))?;
99-
let preds: Forecast = preds.extract(py)?;
99+
let preds: Forecast = preds.bind(py).extract().map_err(|e| {
100+
Box::new(PyErr::from(e)) as Box<dyn std::error::Error + Send + Sync>
101+
})?;
100102
*forecast = preds.into();
101103
Ok(())
102104
})
@@ -116,7 +118,9 @@ impl FittedTrendModel for PyFittedTrendModel {
116118
"error predicting in-sample: {e}"
117119
)))
118120
})?;
119-
let preds: Forecast = preds.extract(py)?;
121+
let preds: Forecast = preds.bind(py).extract().map_err(|e| {
122+
Box::new(PyErr::from(e)) as Box<dyn std::error::Error + Send + Sync>
123+
})?;
120124
*forecast = preds.into();
121125
Ok(())
122126
})

0 commit comments

Comments
 (0)