Skip to content

Commit 5081d58

Browse files
authored
ResourceMgr: Move methods to models (#25)
* clean up hooks, error handling * engine create refactor * service model refactor wip * engine wip * engine wip * database wip * database wip * engine startup fix * misc refactors * fix mypy errors * address pr feedback * address pr feedback * fix bugs, standardize parameter naming * update readme
1 parent bd57d45 commit 5081d58

File tree

23 files changed

+998
-694
lines changed

23 files changed

+998
-694
lines changed

CONTRIBUTING.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Working Directory: $ProjectFileDir$
2727

2828
1. The pre-commit hook should catch linting errors
2929
2. run `mypy src` to check for type errors
30-
3. run `pytest` to run unit tests
30+
3. run `pytest tests/unit` to run unit tests
3131

3232
Note: while there is a `mypy` hook for pre-commit,
3333
I found it too buggy to be worthwhile, so I just run mypy manually.

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# firebolt-sdk
22

3-
### Installation & Usage
3+
### Installation
44

55
* Requires Python `>=3.9`
6-
* Clone this repo
7-
* From the cloned directory: `pip install .`
8-
* See [examples.ipynb](examples.ipynb) for usage
6+
* `pip install firebolt-sdk`
7+
8+
### Usage
9+
10+
See: [examples.ipynb](examples.ipynb).
911

1012
### Configuration
1113

12-
To use the client, you generally will want to set the following environment variables:
14+
To use the SDK, you generally will want to set the following environment variables:
1315
```
1416
FIREBOLT_USER='[email protected]'
1517
FIREBOLT_PASSWORD='*****'
@@ -26,8 +28,8 @@ you can initialize a ResourceManager with:
2628
```python
2729
from firebolt.service.manager import ResourceManager
2830

29-
with ResourceManager() as rm:
30-
print(rm.regions.default_region) # see your default region
31+
rm = ResourceManager()
32+
print(rm.regions.default_region) # see your default region
3133
```
3234

3335
Or you can configure settings manually:
@@ -37,13 +39,13 @@ from firebolt.service.manager import ResourceManager
3739
from firebolt.common.settings import Settings
3840
from pydantic import SecretStr
3941

40-
with ResourceManager(settings=Settings(
41-
server="api.app.firebolt.io",
42-
43-
password=SecretStr("*****"),
44-
default_region="us-east-1",
45-
)) as rm:
46-
print(rm.client.account_id) # see your account id
42+
rm = ResourceManager(settings=Settings(
43+
server="api.app.firebolt.io",
44+
45+
password=SecretStr("*****"),
46+
default_region="us-east-1",
47+
))
48+
print(rm.client.account_id) # see your account id
4749
```
4850

4951
Under the hood, configuration works via Pydantic,

0 commit comments

Comments
 (0)