Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5850a14
:wrench: chore: bump min python to 3.10 and build to 3.13
guptadev21 Sep 18, 2025
ff6a951
:recycle: refactor: update type hints to use built-in types and clean…
guptadev21 Sep 18, 2025
340b271
✨ feat: add Pydantic models for Deployment, Disk, ManagedService, Net…
guptadev21 Sep 24, 2025
17edb02
refactor: refactor code to do model validation
guptadev21 Sep 24, 2025
889383f
test: refactor sync and async tests to use Pydantic models and improv…
guptadev21 Sep 25, 2025
d4843d9
chore: uv sync upgrade
guptadev21 Sep 25, 2025
b64f426
✨ feat: add ManagedService models and update AsyncClient and Client m…
guptadev21 Sep 26, 2025
34b9298
test: enhance async and sync tests with Pydantic model validations fo…
guptadev21 Sep 26, 2025
82470ed
refactor: refactor code structure and remove redundant sections for i…
guptadev21 Sep 29, 2025
8814ba8
fix: set default values for apiVersion and kind in Disk model
guptadev21 Sep 29, 2025
9af30e9
refactor: update organization, user, project, disk, and static route …
guptadev21 Sep 29, 2025
afb5209
feat: add Daemon model and methods to retrieve device daemons in Asyn…
guptadev21 Oct 9, 2025
48efb7e
refactor: simplify item retrieval and pagination logic in walk_pages …
guptadev21 Oct 14, 2025
f6bf016
fix: handle 400 and 403 errors by raising MethodNotAllowedError in ha…
guptadev21 Oct 14, 2025
c27d5c7
fix: update error handling in handle_server_errors to raise UnknownEr…
guptadev21 Oct 14, 2025
265f8ff
fix: update Daemon status field type to allow None values for individ…
guptadev21 Oct 14, 2025
9968dc7
fix: update patch URL in AsyncClient and Client to remove redundant '…
guptadev21 Oct 14, 2025
75f4911
fix: update timeout field type in RosEndpointSpec to allow both int a…
guptadev21 Oct 14, 2025
3c3fbcd
fix: update domainID field type in DeploymentROSNetwork to allow None…
guptadev21 Oct 14, 2025
d23375e
feat: add asynchronous streaming of deployment logs in AsyncClient an…
guptadev21 Oct 29, 2025
59df1d3
fix: add generation field to DeploymentMetadata model
guptadev21 Oct 30, 2025
54a4ddf
fix: update restart field in DeploymentSpec to allow None values
guptadev21 Oct 31, 2025
6b4218f
fix: update EnvArgsSpec to addd exposed_name alias
guptadev21 Oct 31, 2025
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
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12.6
3.13
14 changes: 7 additions & 7 deletions examples/pydantic_source/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from fastapi import FastAPI
from typing import Type, Tuple, Any
from typing import Any

from pydantic import Field, BaseModel
from pydantic_settings import (
Expand Down Expand Up @@ -65,12 +65,12 @@ class RRTreeSource(BaseSettings):
@classmethod
def settings_customise_sources(
cls,
settings_cls: Type[BaseSettings],
settings_cls: type[BaseSettings],
init_settings: PydanticBaseSettingsSource,
env_settings: PydanticBaseSettingsSource,
dotenv_settings: PydanticBaseSettingsSource,
file_secret_settings: PydanticBaseSettingsSource,
) -> Tuple[PydanticBaseSettingsSource, ...]:
) -> tuple[PydanticBaseSettingsSource, ...]:
return (
init_settings,
ConfigTreeSource(
Expand Down Expand Up @@ -121,12 +121,12 @@ class RRTreeSourceWithPrefix(BaseSettings):
@classmethod
def settings_customise_sources(
cls,
settings_cls: Type[BaseSettings],
settings_cls: type[BaseSettings],
init_settings: PydanticBaseSettingsSource,
env_settings: PydanticBaseSettingsSource,
dotenv_settings: PydanticBaseSettingsSource,
file_secret_settings: PydanticBaseSettingsSource,
) -> Tuple[PydanticBaseSettingsSource, ...]:
) -> tuple[PydanticBaseSettingsSource, ...]:
return (
init_settings,
ConfigTreeSource(
Expand Down Expand Up @@ -204,12 +204,12 @@ class RRTreeSourceLocal(BaseSettings):
@classmethod
def settings_customise_sources(
cls,
settings_cls: Type[BaseSettings],
settings_cls: type[BaseSettings],
init_settings: PydanticBaseSettingsSource,
env_settings: PydanticBaseSettingsSource,
dotenv_settings: PydanticBaseSettingsSource,
file_secret_settings: PydanticBaseSettingsSource,
) -> Tuple[PydanticBaseSettingsSource, ...]:
) -> tuple[PydanticBaseSettingsSource, ...]:
return (
init_settings,
ConfigTreeSource(
Expand Down
13 changes: 7 additions & 6 deletions pydantic_source/source.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ast
from typing import Any, Type, Dict, Iterable
from typing import Any
from collections.abc import Iterable
from benedict import benedict
from pathlib import Path

Expand All @@ -13,7 +14,7 @@
class ConfigTreeSource(PydanticBaseSettingsSource):
def __init__(
self,
settings_cls: Type["BaseSettings"],
settings_cls: type["BaseSettings"],
config: Configuration,
tree_name: str = "default",
key_prefix: str = "",
Expand Down Expand Up @@ -74,7 +75,7 @@ def _load_config_tree(self):
return processed_data

# * Methods to process the tree
def _extract_data_api(self, input_data: Dict[str, Any]) -> Dict[str, Any]:
def _extract_data_api(self, input_data: dict[str, Any]) -> dict[str, Any]:
return {
key: self._decode_value(value.get("data"))
for key, value in input_data.items()
Expand Down Expand Up @@ -119,8 +120,8 @@ def _split_metadata(self, data: Iterable) -> Iterable:
return content

# * This method is extracting the data from the raw data and removing the top level prefix
def _process_config_tree(self, raw_data: Dict[str, Any]) -> Dict[str, Any]:
d: Dict[str, Any] = {}
def _process_config_tree(self, raw_data: dict[str, Any]) -> dict[str, Any]:
d: dict[str, Any] = {}
prefix_length = len(self._top_prefix)

if prefix_length == 0:
Expand All @@ -135,7 +136,7 @@ def _process_config_tree(self, raw_data: Dict[str, Any]) -> Dict[str, Any]:
def __call__(self) -> dict[str, Any]:
if self.settings_cls.model_config.get("extra") == "allow":
return self._configtree_data
d: Dict[str, Any] = {}
d: dict[str, Any] = {}

for field_name, field in self.settings_cls.model_fields.items():
field_value, field_key, value_is_complex = self.get_field_value(
Expand Down
10 changes: 3 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ dynamic = ["version"]
description = "Python SDK for rapyuta.io v2 APIs"
dependencies = [
"httpx>=0.27.2",
"munch>=4.0.0",
"pydantic-settings>=2.7.1",
"python-benedict>=0.34.1",
"pyyaml>=6.0.2",
]
readme = "README.md"
license = { file = "LICENSE" }
requires-python = ">= 3.8"
requires-python = ">= 3.10"

[build-system]
requires = ["hatchling"]
Expand Down Expand Up @@ -74,18 +73,15 @@ exclude = [
"venv",
]

# Same as Black.
target-version = "py310"
line-length = 90
indent-width = 4

# Assume Python 3.8
target-version = "py38"

[tool.ruff.lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F", "B", "Q", "W", "N816"]
select = ["E4", "E7", "E9", "F", "B", "Q", "W", "N816", "UP"]
ignore = ["E741", "B904"]

# Allow fix for all enabled rules (when `--fix`) is provided.
Expand Down
2 changes: 1 addition & 1 deletion rapyuta_io_sdk_v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
from rapyuta_io_sdk_v2.config import Configuration
from rapyuta_io_sdk_v2.utils import walk_pages

__version__ = "0.0.1"
__version__ = "0.3.0"
Loading