Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SM-1327] Fix PYO3 Deprecation #897

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions crates/bitwarden-py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ crate-type = ["cdylib"]

[dependencies]
bitwarden-json = { path = "../bitwarden-json", features = ["secrets"] }
pyo3 = { version = "0.21.2", features = ["extension-module"] }
pyo3-log = "0.10.0"
pyo3 = { version = "0.22.1", features = ["extension-module"] }
pyo3-log = "0.11.0"

[build-dependencies]
pyo3-build-config = { version = "0.21.2" }
pyo3-build-config = { version = "0.22.1" }

[target.'cfg(not(target_arch="wasm32"))'.dependencies]
tokio = { version = "1.36.0", features = ["rt-multi-thread", "macros"] }
Expand Down
1 change: 1 addition & 0 deletions crates/bitwarden-py/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub struct BitwardenClient(JsonClient);
#[pymethods]
impl BitwardenClient {
#[new]
#[pyo3(signature = (settings_string=None))]
pub fn new(settings_string: Option<String>) -> Self {
// This will only fail if another logger was already initialized, so we can ignore the
// result
Expand Down
2 changes: 1 addition & 1 deletion crates/bitwarden-py/src/python_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use crate::client::BitwardenClient;

#[pymodule]
fn bitwarden_py(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
fn bitwarden_py(m: &Bound<'_, PyModule>) -> PyResult<()> {

Check warning on line 6 in crates/bitwarden-py/src/python_module.rs

View check run for this annotation

Codecov / codecov/patch

crates/bitwarden-py/src/python_module.rs#L6

Added line #L6 was not covered by tests
m.add_class::<BitwardenClient>()?;
Ok(())
}
Loading