Skip to content

Commit

Permalink
update workflow to test on all major oses
Browse files Browse the repository at this point in the history
  • Loading branch information
synacktraa committed Dec 5, 2024
1 parent bfb72e4 commit 45fb5b3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ on:

jobs:
tests-and-type-check:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
fail-fast: false
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
Expand Down
1 change: 1 addition & 0 deletions orchestr8/_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

DOT_ORCHESTR8 = Path.home() / ".orchestr8"
DOT_ORCHESTR8.mkdir(exist_ok=True)

MKCERT_LOCALHOST_SSL_CERT_FILE = DOT_ORCHESTR8 / "mkcert-localhost.pem"
"""The certificate file for localhost."""
MKCERT_LOCALHOST_SSL_PKEY_FILE = DOT_ORCHESTR8 / "mkcert-localhost-key.pem"
Expand Down
8 changes: 4 additions & 4 deletions orchestr8/adapter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


@overload
def adapt(__obj: Callable[P_Spec, T_Retval]) -> FunctionAdapter[P_Spec, T_Retval]:
def adapt(__obj: Callable[P_Spec, T_Retval]) -> FunctionAdapter[P_Spec, T_Retval]: # type: ignore[type-arg,valid-type]
"""
Create an adapter from a function.
Expand All @@ -23,9 +23,9 @@ def adapt(__obj: Callable[P_Spec, T_Retval]) -> FunctionAdapter[P_Spec, T_Retval


@overload
def adapt(__obj: Type[T_Retval]) -> StructAdapter[T_Retval]:
def adapt(__obj: Type[T_Retval]) -> StructAdapter[T_Retval]: # type: ignore[overload-cannot-match]
"""
Create an adapter from a complex type such as Pydantic Model, TypedDict, dataclass, etc.
Create an adapter from a structured type such as Pydantic Model, TypedDict, dataclass, etc.
Refer`orchestr8.adapter.struct.StructAdapter` for more details.
Expand All @@ -39,7 +39,7 @@ def adapt(__obj: Type[T_Retval]) -> StructAdapter[T_Retval]:

def adapt(__obj: Any) -> Any:
"""
Create an adapter from a function or complex type such as
Create an adapter from a function or structured type such as
Pydantic Model, TypedDict, dataclass, etc.
```python
Expand Down
8 changes: 4 additions & 4 deletions orchestr8/adapter/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Callable, Generic, TypeVar

if version_info >= (3, 10):
from typing import ParamSpec
from typing import ParamSpec # type: ignore[attr-defined]
else:
from typing_extensions import ParamSpec # type: ignore[assignment]

Expand All @@ -16,7 +16,7 @@
T_Retval = TypeVar("T_Retval")


class FunctionAdapter(StructAdapter[T_Retval], Generic[P_Spec, T_Retval]):
class FunctionAdapter(StructAdapter[T_Retval], Generic[P_Spec, T_Retval]): # type: ignore[misc]
"""
A specialized adapter for Python functions, extending StructAdapter to handle function-specific type hints.
Expand Down Expand Up @@ -66,7 +66,7 @@ def create_user(id: str, role: Literal["admin", "user"]) -> bool:
ref_type = "function"
validate_ref = lambda c, r: isfunction(r)

def __init__(self, __fn: Callable[P_Spec, T_Retval]) -> None:
def __init__(self, __fn: Callable[P_Spec, T_Retval]) -> None: # type: ignore[valid-type]
"""
Args:
__fn: The function to create adapter from
Expand All @@ -76,5 +76,5 @@ def __init__(self, __fn: Callable[P_Spec, T_Retval]) -> None:
"""
super().__init__(__fn) # type: ignore[arg-type]

def __call__(self, *args: P_Spec.args, **kwargs: P_Spec.kwargs) -> T_Retval:
def __call__(self, *args: P_Spec.args, **kwargs: P_Spec.kwargs) -> T_Retval: # type: ignore[name-defined]
return super().__call__(*args, **kwargs)

0 comments on commit 45fb5b3

Please sign in to comment.