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

Swap out pyo3 for uniffi #473

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
142 changes: 0 additions & 142 deletions Cargo.lock

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

25 changes: 0 additions & 25 deletions crates/bitwarden-py/Cargo.toml

This file was deleted.

2 changes: 0 additions & 2 deletions crates/bitwarden-py/MANIFEST.in

This file was deleted.

3 changes: 0 additions & 3 deletions crates/bitwarden-py/build.rs

This file was deleted.

2 changes: 0 additions & 2 deletions crates/bitwarden-py/pyproject.toml

This file was deleted.

24 changes: 0 additions & 24 deletions crates/bitwarden-py/src/client.rs

This file was deleted.

5 changes: 0 additions & 5 deletions crates/bitwarden-py/src/lib.rs

This file was deleted.

9 changes: 0 additions & 9 deletions crates/bitwarden-py/src/python_module.rs

This file was deleted.

3 changes: 3 additions & 0 deletions crates/bitwarden-uniffi/uniffi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ generate_immutable_records = true
ffi_module_name = "BitwardenFFI"
module_name = "BitwardenSDK"
generate_immutable_records = true

[bindings.python]
cdylib_name = "bitwarden_uniffi"
7 changes: 4 additions & 3 deletions crates/bitwarden/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ rust-version = "1.57"
[features]
default = ["secrets"]

secrets = [] # Secrets manager API
internal = [] # Internal testing methods
mobile = ["uniffi", "internal"] # Mobile-specific features
secrets = [] # Secrets manager API
secrets_uniffi = ["uniffi", "secrets"] # Uniffi-bindings for secrets manager API
internal = [] # Internal testing methods
mobile = ["uniffi", "internal"] # Mobile-specific features

wasm-bindgen = ["chrono/wasmbind"]

Expand Down
4 changes: 4 additions & 0 deletions languages/python/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*.egg-info
bitwarden_py*.so
__pycache__
venv

bitwarden_sdk/bitwarden_sdk/bitwarden.py
bitwarden_sdk/bitwarden_sdk/bitwarden_uniffi.py
File renamed without changes.
18 changes: 18 additions & 0 deletions languages/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,24 @@
pip install python-dateutil
```

# Build

From the `languages/python/` directory,

```bash
# Maturin currently only supports a single source file, so we need to manually build the library
uniffi-bindgen generate ../../target/debug/libbitwarden_uniffi.dylib \
--library \
--language python \
--no-format \
--out-dir ./bitwarden_sdk/bitwarden_sdk

maturin build

# Install the library
maturing develop
```

# Installation

From the `languages/python/` directory,
Expand Down
Empty file.
Loading