Skip to content

Commit

Permalink
Use Union for Python 3.9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
MHHukiewitz committed Nov 22, 2023
1 parent daafc8f commit 93ab309
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aleph_message/models/execution/program.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Literal, Optional
from typing import Literal, Optional, Union

from pydantic import Field

Expand All @@ -27,15 +27,15 @@ class Entrypoint(HashableModel):
"""

name: str
type: Literal["python-asgi"] | Literal["bash"] | Literal["binary"] | Literal["node.js"]
type: Union[Literal["python-asgi"], Literal["bash"], Literal["binary"], Literal["node.js"]]
args: list[str]


class CodeContent(HashableModel):
"""Reference to the StoreMessage that contains the code or program to be executed."""

encoding: Encoding
entrypoint: Entrypoint | str
entrypoint: Union[Entrypoint, str]
ref: ItemHash # Must reference a StoreMessage
use_latest: bool = False

Expand Down

0 comments on commit 93ab309

Please sign in to comment.