Skip to content

Commit

Permalink
SM-1327: Fix PYO3 Deprecation (#897)
Browse files Browse the repository at this point in the history
## 🎟️ Tracking

https://bitwarden.atlassian.net/browse/SM-1327

## 📔 Objective

Update all PYO3 dependencies and fix the necessary deprecation notices.

Thanks @Thomas-Avery and @dani-garcia for the collaboration!

## ⏰ Reminders before review

- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or
informed the documentation
  team

## 🦮 Reviewer guidelines

<!-- Suggested interactions but feel free to use (or not) as you desire!
-->

- 👍 (`:+1:`) or similar for great changes
- 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info
- ❓ (`:question:`) for questions
- 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry
that's not quite a confirmed
  issue and could potentially benefit from discussion
- 🎨 (`:art:`) for suggestions / improvements
- ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or
concerns needing attention
- 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or
indications of technical debt
- ⛏ (`:pick:`) for minor or nitpick changes
  • Loading branch information
coltonhurst authored Jul 17, 2024
1 parent e80c02c commit 740895c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
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 pyo3::prelude::*;
use crate::client::BitwardenClient;

#[pymodule]
fn bitwarden_py(_py: Python<'_>, m: &PyModule) -> PyResult<()> {
fn bitwarden_py(m: &Bound<'_, PyModule>) -> PyResult<()> {
m.add_class::<BitwardenClient>()?;
Ok(())
}

0 comments on commit 740895c

Please sign in to comment.