Skip to content

Commit

Permalink
SDK update generated by liblab
Browse files Browse the repository at this point in the history
  • Loading branch information
doppler-bot committed Sep 14, 2023
1 parent 7c16932 commit 9dc4f89
Show file tree
Hide file tree
Showing 224 changed files with 5,916 additions and 1,878 deletions.
12 changes: 12 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python SDK",
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
"postCreateCommand": "pip3 install --user -r requirements.txt && cd example && sh install.sh",
"customizations": {
"codespaces":{
"openFiles": ["examples/sample.py", "examples/README.md"]
}
}
}
33 changes: 33 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# doppler-sdk-example
A basic example of how to use the doppler-sdk package.

## Installation

If `doppler-sdk` is published to pypi:
```sh
pip install doppler-sdk==1.1.2
```

In the event `doppler-sdk` is not published to pypi, you can install it locally by running the following command in the example folder:
```sh
. ./install.sh
```

This will create and start a virtual environment and install the package locally in it.

To close the virtual environment run:
```sh
deactivate
```

To re-activate the virtual environment once it is installed run:
```sh
source .venv/bin/activate
```

## Usage

To run the example, run the following command in the examples folder:
```sh
python sample.py
```
5 changes: 5 additions & 0 deletions examples/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
python -m venv .venv
source .venv/bin/activate
pip install build
python -m build --outdir dist ../
pip install dist/doppler_sdk-1.1.2-py3-none-any.whl
5 changes: 5 additions & 0 deletions examples/install_py3.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
python3 -m venv .venv
source .venv/bin/activate
pip3 install build
python3 -m build --outdir dist ../
pip3 install dist/doppler_sdk-1.1.2-py3-none-any.whl
11 changes: 11 additions & 0 deletions examples/sample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from pprint import pprint
from dopplersdk import DopplerSDK

DOPPLERSDK_ACCESS_TOKEN = ""

sdk = DopplerSDK()
sdk.set_access_token(DOPPLERSDK_ACCESS_TOKEN)

results = sdk.projects.list()

pprint(vars(results))
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "doppler-sdk"
version = "1.1.1"
version = "1.1.2"
license = { text = "SEE LICENSE IN LICENSE" }
authors = [
{ name="Example Author", email="author@example.com" },
Expand Down
Loading

0 comments on commit 9dc4f89

Please sign in to comment.