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-1098: Update Python Wrapper README Instructions #592

Merged
merged 6 commits into from
Feb 13, 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
1 change: 1 addition & 0 deletions languages/python/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.egg-info
bitwarden_py*.so
__pycache__
.venv
23 changes: 23 additions & 0 deletions languages/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,26 @@ Set the `ORGANIZATION_ID` and `ACCESS_TOKEN` environment variables to your organ
```bash
python3 ./example.py
```

# Using Virtual Environments

If you would like to build & run the script within a virtual environment you can do the following.

## Build

```bash
npm run schemas # generate schemas.py

cd languages/python/
python3 -m venv .venv
maturin develop
```

## Run

```bash
source .venv/bin/activate
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is under run and we do not know if they use a venv or some other approach.

Copy link
Member Author

@coltonhurst coltonhurst Feb 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this to a Using Virtual Environments section, away from the Run section. If anything, it will hopefully help those who are less familiar with Python get started.

d2b769a

python3 ./example.py

deactivate # run this to close the virtual session
```
Loading