Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 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
32 changes: 14 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push]
jobs:
static-checks:
runs-on: ubuntu-latest
strategy: &python-matrix
strategy:
matrix:
python-version:
- "3.11"
Expand All @@ -30,6 +30,9 @@ jobs:
- name: Install project dependencies
run: uv sync --locked --all-extras --dev --all-packages

- name: Start localtunnel
run: npx localtunnel --port 5000 2>&1 | tee tunnel.log &
Comment thread
AHGIJMKLKKZNPJKQR marked this conversation as resolved.
Outdated
Comment thread
PiotrWodecki marked this conversation as resolved.
Outdated

- name: Format
run: uv run format_check

Expand All @@ -38,21 +41,14 @@ jobs:

- name: Type check
run: uv run pyright

test:
runs-on: ubuntu-latest
strategy: *python-matrix
env:
PYTHON_VERSION: ${{ matrix.python-version }}
name: test
steps:
- uses: actions/checkout@v4

- name: Log in to GitHub Container Registry
run: echo "${{ secrets.PACKAGE_ACCESS_TOKEN }}" | docker login ghcr.io -u USERNAME --password-stdin


- name: Run tests
run: docker compose -f docker-compose-test.yaml up test --exit-code-from test

- name: Tear down test containers
run: docker compose -f docker-compose-test.yaml down
run: |
WEBHOOK_SERVER_URL="$(grep -o 'https://[^ ]*' tunnel.log | head -n 1)"
if [ -z "$WEBHOOK_SERVER_URL" ]; then
echo "Failed to setup localtunnel!"
fi
uv run pytest
env:
FISHJAM_ID: ${{ secrets.CI_FISHJAM_ID }}
FISHJAM_MANAGEMENT_TOKEN: ${{ secrets.CI_FISHJAM_MANAGEMENT_TOKEN }}
Comment thread
AHGIJMKLKKZNPJKQR marked this conversation as resolved.
Outdated
75 changes: 0 additions & 75 deletions docker-compose-test.yaml

This file was deleted.

20 changes: 10 additions & 10 deletions fishjam/_openapi_client/api/room/add_peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@

from ... import errors
from ...client import AuthenticatedClient, Client
from ...models.add_peer_body import AddPeerBody
from ...models.error import Error
from ...models.peer_config import PeerConfig
from ...models.peer_details_response import PeerDetailsResponse
from ...types import Response


def _get_kwargs(
room_id: str,
*,
body: AddPeerBody,
body: PeerConfig,
) -> dict[str, Any]:
headers: dict[str, Any] = {}

Expand Down Expand Up @@ -81,13 +81,13 @@ def sync_detailed(
room_id: str,
*,
client: AuthenticatedClient,
body: AddPeerBody,
body: PeerConfig,
) -> Response[Union[Error, PeerDetailsResponse]]:
"""Create peer

Args:
room_id (str):
body (AddPeerBody):
body (PeerConfig): Peer configuration

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -113,13 +113,13 @@ def sync(
room_id: str,
*,
client: AuthenticatedClient,
body: AddPeerBody,
body: PeerConfig,
) -> Optional[Union[Error, PeerDetailsResponse]]:
"""Create peer

Args:
room_id (str):
body (AddPeerBody):
body (PeerConfig): Peer configuration

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -140,13 +140,13 @@ async def asyncio_detailed(
room_id: str,
*,
client: AuthenticatedClient,
body: AddPeerBody,
body: PeerConfig,
) -> Response[Union[Error, PeerDetailsResponse]]:
"""Create peer

Args:
room_id (str):
body (AddPeerBody):
body (PeerConfig): Peer configuration

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand All @@ -170,13 +170,13 @@ async def asyncio(
room_id: str,
*,
client: AuthenticatedClient,
body: AddPeerBody,
body: PeerConfig,
) -> Optional[Union[Error, PeerDetailsResponse]]:
"""Create peer

Args:
room_id (str):
body (AddPeerBody):
body (PeerConfig): Peer configuration

Raises:
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
Expand Down
4 changes: 2 additions & 2 deletions fishjam/_openapi_client/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Contains all the data models used in inputs/outputs"""

from .add_peer_body import AddPeerBody
from .agent_output import AgentOutput
from .audio_format import AudioFormat
from .audio_sample_rate import AudioSampleRate
from .error import Error
from .peer import Peer
from .peer_config import PeerConfig
from .peer_details_response import PeerDetailsResponse
from .peer_details_response_data import PeerDetailsResponseData
from .peer_metadata import PeerMetadata
Expand Down Expand Up @@ -41,12 +41,12 @@
from .web_rtc_metadata import WebRTCMetadata

__all__ = (
"AddPeerBody",
"AgentOutput",
"AudioFormat",
"AudioSampleRate",
"Error",
"Peer",
"PeerConfig",
"PeerDetailsResponse",
"PeerDetailsResponseData",
"PeerMetadata",
Expand Down
21 changes: 1 addition & 20 deletions fishjam/_openapi_client/models/agent_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
)

from attrs import define as _attrs_define
from attrs import field as _attrs_field

from ..models.audio_format import AudioFormat
from ..models.audio_sample_rate import AudioSampleRate
Expand All @@ -26,7 +25,6 @@ class AgentOutput:

audio_format: Union[Unset, AudioFormat] = UNSET
audio_sample_rate: Union[Unset, AudioSampleRate] = UNSET
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
audio_format: Union[Unset, str] = UNSET
Expand All @@ -38,7 +36,7 @@ def to_dict(self) -> dict[str, Any]:
audio_sample_rate = self.audio_sample_rate.value

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)

field_dict.update({})
if audio_format is not UNSET:
field_dict["audioFormat"] = audio_format
Expand Down Expand Up @@ -69,21 +67,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
audio_sample_rate=audio_sample_rate,
)

agent_output.additional_properties = d
return agent_output

@property
def additional_keys(self) -> list[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]

def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
)

from attrs import define as _attrs_define
from attrs import field as _attrs_field

from ..models.peer_type import PeerType

Expand All @@ -16,20 +15,20 @@
from ..models.peer_options_web_rtc import PeerOptionsWebRTC


T = TypeVar("T", bound="AddPeerBody")
T = TypeVar("T", bound="PeerConfig")


@_attrs_define
class AddPeerBody:
"""
class PeerConfig:
Comment thread
AHGIJMKLKKZNPJKQR marked this conversation as resolved.
"""Peer configuration

Attributes:
options (Union['PeerOptionsAgent', 'PeerOptionsWebRTC']): Peer-specific options
type_ (PeerType): Peer type Example: webrtc.
"""

options: Union["PeerOptionsAgent", "PeerOptionsWebRTC"]
type_: PeerType
Comment thread
AHGIJMKLKKZNPJKQR marked this conversation as resolved.
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)

def to_dict(self) -> dict[str, Any]:
from ..models.peer_options_web_rtc import PeerOptionsWebRTC
Expand All @@ -43,7 +42,7 @@ def to_dict(self) -> dict[str, Any]:
type_ = self.type_.value

field_dict: dict[str, Any] = {}
field_dict.update(self.additional_properties)

field_dict.update({
"options": options,
"type": type_,
Expand Down Expand Up @@ -81,26 +80,9 @@ def _parse_options(

type_ = PeerType(d.pop("type"))

add_peer_body = cls(
peer_config = cls(
options=options,
type_=type_,
)

add_peer_body.additional_properties = d
return add_peer_body

@property
def additional_keys(self) -> list[str]:
return list(self.additional_properties.keys())

def __getitem__(self, key: str) -> Any:
return self.additional_properties[key]

def __setitem__(self, key: str, value: Any) -> None:
self.additional_properties[key] = value

def __delitem__(self, key: str) -> None:
del self.additional_properties[key]

def __contains__(self, key: str) -> bool:
return key in self.additional_properties
return peer_config
Loading
Loading