orca-python 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- __init__.py +0 -0
- orca_python/__init__.py +3 -0
- orca_python/envs.py +24 -0
- orca_python/exceptions.py +14 -0
- orca_python/main.py +686 -0
- orca_python/py.typed +0 -0
- orca_python-0.2.0.dist-info/LICENSE +16 -0
- orca_python-0.2.0.dist-info/METADATA +125 -0
- orca_python-0.2.0.dist-info/RECORD +17 -0
- orca_python-0.2.0.dist-info/WHEEL +4 -0
- service_pb2.py +145 -0
- service_pb2.pyi +196 -0
- service_pb2_grpc.py +293 -0
- vendor/__init__.py +0 -0
- vendor/validate_pb2.py +448 -0
- vendor/validate_pb2.pyi +618 -0
- vendor/validate_pb2_grpc.py +24 -0
__init__.py
ADDED
File without changes
|
orca_python/__init__.py
ADDED
orca_python/envs.py
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
import os
|
2
|
+
from typing import Tuple
|
3
|
+
|
4
|
+
from orca_python.exceptions import MissingDependency
|
5
|
+
|
6
|
+
|
7
|
+
def getenvs() -> Tuple[str, ...]:
|
8
|
+
orcaserver = os.getenv("ORCASERVER", "")
|
9
|
+
if orcaserver == "":
|
10
|
+
MissingDependency("ORCASERVER is required")
|
11
|
+
orcaserver = orcaserver.lstrip("grpc://")
|
12
|
+
|
13
|
+
port = os.getenv("PORT", "")
|
14
|
+
if port == "":
|
15
|
+
MissingDependency("PORT required")
|
16
|
+
|
17
|
+
host = os.getenv("HOST", "")
|
18
|
+
if host == "":
|
19
|
+
MissingDependency("HOST is required")
|
20
|
+
|
21
|
+
return orcaserver, port, host
|
22
|
+
|
23
|
+
|
24
|
+
ORCASERVER, PORT, HOST = getenvs()
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class BaseOrcaException(Exception):
|
2
|
+
"""Base exception for the Python Orca client"""
|
3
|
+
|
4
|
+
|
5
|
+
class InvalidAlgorithmArgument(BaseOrcaException):
|
6
|
+
"""Raised when an argument to `@algorithm` is not correct"""
|
7
|
+
|
8
|
+
|
9
|
+
class InvalidDependency(BaseOrcaException):
|
10
|
+
"""Raised when a dependency is invalid"""
|
11
|
+
|
12
|
+
|
13
|
+
class MissingDependency(BaseOrcaException):
|
14
|
+
"""Raised when a dependency is missing"""
|