Skip to content

Commit d3f1aa7

Browse files
authored
Merge pull request #15 from rapyuta-robotics/hotfix/pydantic-source
fix(pydantic_source): moved pydantic_source under rapyuta_io_sdk_v2
2 parents 78b1cbf + c71f32c commit d3f1aa7

File tree

6 files changed

+24
-20
lines changed

6 files changed

+24
-20
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
ENV = 'environment'
2-
AUTH_TOKEN = 'auth token'
3-
ORG = 'organization guid'
4-
PROJ = 'project guid'
2+
RIO_AuthToken = 'auth token'
3+
RIO_ORGANIZATION_ID = 'organization guid'
4+
RIO_PROJECT_ID = 'project guid'
Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
{
2-
"apis": {
3-
"services": {
4-
"value": "services inside the local file",
5-
"description": "Description"
6-
}
7-
},
8-
"common": {
9-
"value": "common in local file",
10-
"description": "Common Description"
2+
"apis": {
3+
"services": {
4+
"value": "services inside the local file",
5+
"metadata": {
6+
"description": "Description"
7+
}
118
}
12-
}
9+
},
10+
"common": {
11+
"value": "common in local file",
12+
"metadata": {
13+
"description": "Common Description"
14+
}
15+
}
16+
}

examples/pydantic_source/main.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
)
1010

1111
from rapyuta_io_sdk_v2 import Configuration
12-
from pydantic_source import ConfigTreeSource
12+
from rapyuta_io_sdk_v2.pydantic_source import ConfigTreeSource
1313

1414
app = FastAPI()
1515

@@ -24,16 +24,16 @@ class AuthConfig(BaseSettings):
2424
model_config = SettingsConfigDict(env_file=".env")
2525

2626
env: str
27-
auth_token: str
28-
organization_guid: str = Field(alias="ORG")
29-
project_guid: str = Field(alias="PROJ")
27+
auth_token: str = Field(alias="RIO_AuthToken")
28+
organization_guid: str = Field(alias="RIO_ORGANIZATION_ID")
29+
project_guid: str = Field(alias="RIO_PROJECT_ID")
3030

3131
def __new__(cls, *args, **kwargs):
3232
instance = super().__new__(cls)
3333
cls.__init__(instance, *args, **kwargs)
3434

3535
return Configuration(
36-
auth_token=instance.auth_token,
36+
auth_token=instance.auth_token.removeprefix("Bearer "),
3737
environment=instance.env,
3838
organization_guid=instance.organization_guid,
3939
project_guid=instance.project_guid,
@@ -251,4 +251,4 @@ def get_configtrees_local():
251251
if __name__ == "__main__":
252252
import uvicorn
253253

254-
uvicorn.run(app, host="0.0.0.0", port=8000, reload=True)
254+
uvicorn.run(app, host="0.0.0.0", port=8000)

pydantic_source/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from rapyuta_io_sdk_v2.pydantic_source.source import ConfigTreeSource # noqa: F401
File renamed without changes.

0 commit comments

Comments
 (0)