Skip to content

Commit 9f1b84f

Browse files
committed
python: update deps
1 parent 9018e04 commit 9f1b84f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

python/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ mflow = ["microvmi/mflow"]
2828

2929
[dependencies]
3030
log = "0.4"
31-
env_logger = "0.9.0"
32-
thiserror = "1.0"
31+
env_logger = "0.11.6"
32+
thiserror = "2.0.11"
3333
microvmi = { path = "../" }
3434

3535
[dependencies.pyo3]
36-
version = "0.14.5"
37-
features = ["extension-module"]
36+
version = "0.21.0"
37+
features = ["extension-module", "abi3-py39"]
3838

3939
[package.metadata.release]
4040
# releases are managed by cargo release, but publication is done on the CI

python/src/lib.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use params::{CommonInitParamsPy, DriverInitParamsPy, KVMInitParamsPy, MemflowIni
1515

1616
/// microvmi Python module declaration
1717
#[pymodule]
18-
fn pymicrovmi(_py: Python, m: &PyModule) -> PyResult<()> {
18+
fn pymicrovmi(_py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
1919
// init the env logger at module init
2020
env_logger::init();
2121

@@ -64,7 +64,7 @@ impl MicrovmiExt {
6464
/// driver_type (int, optional): the hypervisor driver type on which the library should be initialized.
6565
/// init_param (DriverInitParamPy, optional): initialization parameters for driver initialization
6666
#[new]
67-
#[args(driver_type = "None", init_params = "None")]
67+
#[pyo3(signature = (driver_type=None, init_params=None))]
6868
fn new(driver_type: Option<u32>, init_params: Option<DriverInitParamsPy>) -> PyResult<Self> {
6969
info!("Microvmi Python init");
7070
debug!(
@@ -118,7 +118,7 @@ impl MicrovmiExt {
118118
size: usize,
119119
) -> PyResult<(&'p PyBytes, u64)> {
120120
let mut bytes_read: u64 = 0;
121-
let pybuffer: &PyBytes = PyBytes::new_with(py, size, |buffer| {
121+
let pybuffer: &PyBytes = PyBytes::new_bound_with(py, size, |buffer| {
122122
self.driver
123123
.read_physical(paddr, buffer, &mut bytes_read)
124124
.ok();
@@ -133,7 +133,7 @@ impl MicrovmiExt {
133133
/// Args:
134134
/// paddr (int): the physical address to start reading from
135135
/// buffer (bytearray): the buffer to read into
136-
fn read_physical_into(&self, paddr: u64, buffer: &PyByteArray) -> u64 {
136+
fn read_physical_into(&self, paddr: u64, buffer: &Bound<'_, PyByteArray>) -> u64 {
137137
let mut_buf: &mut [u8] = unsafe { buffer.as_bytes_mut() };
138138
let mut bytes_read: u64 = 0;
139139
// ignore read error

0 commit comments

Comments
 (0)