flamepy 0.3.0__tar.gz → 0.6.0__tar.gz
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.
- flamepy-0.6.0/PKG-INFO +204 -0
- flamepy-0.6.0/README.md +165 -0
- {flamepy-0.3.0 → flamepy-0.6.0}/pyproject.toml +53 -36
- flamepy-0.6.0/src/flamepy/__init__.py +152 -0
- flamepy-0.6.0/src/flamepy/__main__.py +14 -0
- flamepy-0.6.0/src/flamepy/cache/__init__.py +30 -0
- flamepy-0.6.0/src/flamepy/core/__init__.py +180 -0
- flamepy-0.6.0/src/flamepy/core/cache.py +1305 -0
- flamepy-0.6.0/src/flamepy/core/client.py +954 -0
- flamepy-0.6.0/src/flamepy/core/service.py +283 -0
- flamepy-0.6.0/src/flamepy/core/types.py +547 -0
- flamepy-0.6.0/src/flamepy/proto/__init__.py +15 -0
- flamepy-0.6.0/src/flamepy/proto/frontend_pb2.py +76 -0
- {flamepy-0.3.0/src/flamepy → flamepy-0.6.0/src/flamepy/proto}/frontend_pb2_grpc.py +185 -55
- flamepy-0.6.0/src/flamepy/proto/shim_pb2.py +44 -0
- {flamepy-0.3.0/src/flamepy → flamepy-0.6.0/src/flamepy/proto}/shim_pb2_grpc.py +19 -19
- flamepy-0.6.0/src/flamepy/proto/types_pb2.py +105 -0
- {flamepy-0.3.0/src/flamepy → flamepy-0.6.0/src/flamepy/proto}/types_pb2_grpc.py +2 -2
- flamepy-0.6.0/src/flamepy/runner/__init__.py +31 -0
- flamepy-0.6.0/src/flamepy/runner/__main__.py +17 -0
- flamepy-0.6.0/src/flamepy/runner/e2e.py +209 -0
- flamepy-0.6.0/src/flamepy/runner/helper.py +341 -0
- flamepy-0.6.0/src/flamepy/runner/runner.py +812 -0
- flamepy-0.6.0/src/flamepy/runner/runpy.py +418 -0
- flamepy-0.6.0/src/flamepy/runner/storage.py +400 -0
- flamepy-0.6.0/src/flamepy/runner/types.py +155 -0
- flamepy-0.6.0/src/flamepy/service/__init__.py +17 -0
- flamepy-0.6.0/src/flamepy/service/client.py +196 -0
- flamepy-0.6.0/src/flamepy/service/instance.py +182 -0
- flamepy-0.6.0/src/flamepy/util/__init__.py +25 -0
- flamepy-0.6.0/src/flamepy.egg-info/PKG-INFO +204 -0
- flamepy-0.6.0/src/flamepy.egg-info/SOURCES.txt +41 -0
- flamepy-0.6.0/src/flamepy.egg-info/entry_points.txt +2 -0
- flamepy-0.6.0/src/flamepy.egg-info/requires.txt +18 -0
- flamepy-0.6.0/tests/test_cache.py +1235 -0
- flamepy-0.6.0/tests/test_core.py +677 -0
- flamepy-0.6.0/tests/test_runner.py +986 -0
- flamepy-0.6.0/tests/test_runner_e2e.py +156 -0
- flamepy-0.6.0/tests/test_service.py +739 -0
- flamepy-0.3.0/PKG-INFO +0 -177
- flamepy-0.3.0/README.md +0 -146
- flamepy-0.3.0/src/flamepy/__init__.py +0 -82
- flamepy-0.3.0/src/flamepy/client.py +0 -433
- flamepy-0.3.0/src/flamepy/frontend_pb2.py +0 -68
- flamepy-0.3.0/src/flamepy/service.py +0 -225
- flamepy-0.3.0/src/flamepy/shim_pb2.py +0 -46
- flamepy-0.3.0/src/flamepy/test_flame.py +0 -195
- flamepy-0.3.0/src/flamepy/types.py +0 -159
- flamepy-0.3.0/src/flamepy/types_pb2.py +0 -95
- flamepy-0.3.0/src/flamepy.egg-info/PKG-INFO +0 -177
- flamepy-0.3.0/src/flamepy.egg-info/SOURCES.txt +0 -19
- flamepy-0.3.0/src/flamepy.egg-info/requires.txt +0 -10
- {flamepy-0.3.0 → flamepy-0.6.0}/LICENSE +0 -0
- {flamepy-0.3.0 → flamepy-0.6.0}/setup.cfg +0 -0
- {flamepy-0.3.0 → flamepy-0.6.0}/src/flamepy.egg-info/dependency_links.txt +0 -0
- {flamepy-0.3.0 → flamepy-0.6.0}/src/flamepy.egg-info/top_level.txt +0 -0
flamepy-0.6.0/PKG-INFO
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: flamepy
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Python SDK for Flame, a distributed system for Agentic AI
|
|
5
|
+
Author-email: XFLOPS Authors <support@xflops.io>
|
|
6
|
+
Project-URL: Homepage, https://xflops.io
|
|
7
|
+
Project-URL: Repository, https://github.com/xflops/flame
|
|
8
|
+
Project-URL: Issues, https://github.com/xflops/flame/issues
|
|
9
|
+
Keywords: distributed system,agentic ai,flame,sdk
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Requires-Python: >=3.9
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: grpcio>=1.80
|
|
22
|
+
Requires-Dist: grpcio-tools>=1.80
|
|
23
|
+
Requires-Dist: protobuf>=6.31.0
|
|
24
|
+
Requires-Dist: pydantic>=2.11.0
|
|
25
|
+
Requires-Dist: fastapi>=0.115.0
|
|
26
|
+
Requires-Dist: uvicorn>=0.35.0
|
|
27
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
28
|
+
Requires-Dist: pymongo>=4
|
|
29
|
+
Requires-Dist: requests>=2.32
|
|
30
|
+
Requires-Dist: httpx>=0.28
|
|
31
|
+
Requires-Dist: cloudpickle>=3.1
|
|
32
|
+
Requires-Dist: pyarrow>=18.1.0
|
|
33
|
+
Provides-Extra: dev
|
|
34
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
35
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
36
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
37
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
38
|
+
Dynamic: license-file
|
|
39
|
+
|
|
40
|
+
# Flame Python SDK
|
|
41
|
+
|
|
42
|
+
Python SDK for the Flame, a distributed system for Agentic AI.
|
|
43
|
+
|
|
44
|
+
For the user guide, see [Flame Python SDK](../../docs/sdk/python.md). For the detailed API surface, see [API.md](docs/API.md).
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install flamepy
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Quick Start
|
|
53
|
+
|
|
54
|
+
```python
|
|
55
|
+
import flamepy
|
|
56
|
+
|
|
57
|
+
def main():
|
|
58
|
+
# Create a session with the application, e.g. Agent
|
|
59
|
+
session = flamepy.create_session("flmping")
|
|
60
|
+
|
|
61
|
+
# Create and run a task
|
|
62
|
+
resp = session.invoke(b"task input data")
|
|
63
|
+
|
|
64
|
+
# Handle the output of task
|
|
65
|
+
print(resp)
|
|
66
|
+
|
|
67
|
+
# Close session
|
|
68
|
+
session.close()
|
|
69
|
+
|
|
70
|
+
if __name__ == "__main__":
|
|
71
|
+
main()
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Verify A Runner Cluster
|
|
75
|
+
|
|
76
|
+
After configuring `~/.flame/flame.yaml` for a running cluster with session manager, object cache, executor manager, and the `flmrun` template application, run:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
python -m flamepy.runner.e2e
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Installed wheels also provide:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
flamepy-runner-e2e
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The check packages a tiny temporary project and verifies Runner function calls, `ObjectFuture` chaining, and a stateful instance service. Use `--json` for machine-readable output and `--python-version 3.12` to verify a specific executor Python runtime.
|
|
89
|
+
|
|
90
|
+
## API Reference
|
|
91
|
+
|
|
92
|
+
### Session
|
|
93
|
+
|
|
94
|
+
Represents a computing session with application, e.g. Agent, Tools.
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
# Create a session
|
|
98
|
+
session = flamepy.create_session("my-app")
|
|
99
|
+
|
|
100
|
+
# Close a session
|
|
101
|
+
session.close()
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Task
|
|
105
|
+
|
|
106
|
+
Represents individual computing tasks within a session.
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from concurrent.futures import wait
|
|
110
|
+
|
|
111
|
+
# Run a task synchronously (blocks until complete)
|
|
112
|
+
result = session.invoke(b"input data")
|
|
113
|
+
|
|
114
|
+
# Run a task asynchronously (returns Future immediately)
|
|
115
|
+
future = session.run(b"input data")
|
|
116
|
+
result = future.result() # Wait for completion
|
|
117
|
+
|
|
118
|
+
# Run multiple tasks in parallel
|
|
119
|
+
futures = [session.run(f"input {i}".encode()) for i in range(10)]
|
|
120
|
+
wait(futures) # Wait for all tasks to complete
|
|
121
|
+
results = [f.result() for f in futures]
|
|
122
|
+
|
|
123
|
+
# Create a task and get task object
|
|
124
|
+
task = session.create_task(b"input data")
|
|
125
|
+
|
|
126
|
+
# Get task status
|
|
127
|
+
task = session.get_task(task.id)
|
|
128
|
+
|
|
129
|
+
# Watch task progress
|
|
130
|
+
for update in session.watch_task(task.id):
|
|
131
|
+
print(f"Task state: {update.state}")
|
|
132
|
+
if update.is_completed():
|
|
133
|
+
break
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Error Handling
|
|
137
|
+
|
|
138
|
+
The SDK provides custom exception types for different error scenarios:
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
from flamepy import FlameError, FlameErrorCode
|
|
142
|
+
|
|
143
|
+
try:
|
|
144
|
+
session = flamepy.create_session("flmping")
|
|
145
|
+
except FlameError as e:
|
|
146
|
+
if e.code == FlameErrorCode.INVALID_CONFIG:
|
|
147
|
+
print("Configuration error:", e.message)
|
|
148
|
+
elif e.code == FlameErrorCode.INVALID_STATE:
|
|
149
|
+
print("State error:", e.message)
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Development
|
|
153
|
+
|
|
154
|
+
To set up the development environment:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# Clone the repository
|
|
158
|
+
git clone https://github.com/xflops/flame.git
|
|
159
|
+
cd flame/sdk/python
|
|
160
|
+
|
|
161
|
+
# Install in development mode
|
|
162
|
+
# Note: Use --no-build-isolation if you have setuptools>=61.0 installed
|
|
163
|
+
python3 -m pip install -e . --user --no-build-isolation
|
|
164
|
+
|
|
165
|
+
# Or build and install the wheel
|
|
166
|
+
python3 -m build --wheel --no-isolation
|
|
167
|
+
python3 -m pip install dist/flamepy-0.6.0-py3-none-any.whl --user
|
|
168
|
+
|
|
169
|
+
# Install development dependencies
|
|
170
|
+
pip install -e .[dev]
|
|
171
|
+
|
|
172
|
+
# Run tests
|
|
173
|
+
pytest
|
|
174
|
+
|
|
175
|
+
# Format code
|
|
176
|
+
ruff format
|
|
177
|
+
|
|
178
|
+
# Type checking
|
|
179
|
+
mypy flamepy/
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Requirements
|
|
183
|
+
|
|
184
|
+
- Python >= 3.9
|
|
185
|
+
- setuptools >= 61.0 (for building from source)
|
|
186
|
+
|
|
187
|
+
### Troubleshooting
|
|
188
|
+
|
|
189
|
+
If you encounter issues with the package name showing as "UNKNOWN":
|
|
190
|
+
|
|
191
|
+
1. Make sure you have `setuptools>=61.0` installed:
|
|
192
|
+
```bash
|
|
193
|
+
python3 -m pip install --user --upgrade "setuptools>=61.0"
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
2. Clean any stale build artifacts:
|
|
197
|
+
```bash
|
|
198
|
+
rm -rf dist build src/flamepy.egg-info *.egg-info
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
3. Use `--no-build-isolation` flag when installing:
|
|
202
|
+
```bash
|
|
203
|
+
python3 -m pip install . --user --no-build-isolation
|
|
204
|
+
```
|
flamepy-0.6.0/README.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# Flame Python SDK
|
|
2
|
+
|
|
3
|
+
Python SDK for the Flame, a distributed system for Agentic AI.
|
|
4
|
+
|
|
5
|
+
For the user guide, see [Flame Python SDK](../../docs/sdk/python.md). For the detailed API surface, see [API.md](docs/API.md).
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install flamepy
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```python
|
|
16
|
+
import flamepy
|
|
17
|
+
|
|
18
|
+
def main():
|
|
19
|
+
# Create a session with the application, e.g. Agent
|
|
20
|
+
session = flamepy.create_session("flmping")
|
|
21
|
+
|
|
22
|
+
# Create and run a task
|
|
23
|
+
resp = session.invoke(b"task input data")
|
|
24
|
+
|
|
25
|
+
# Handle the output of task
|
|
26
|
+
print(resp)
|
|
27
|
+
|
|
28
|
+
# Close session
|
|
29
|
+
session.close()
|
|
30
|
+
|
|
31
|
+
if __name__ == "__main__":
|
|
32
|
+
main()
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Verify A Runner Cluster
|
|
36
|
+
|
|
37
|
+
After configuring `~/.flame/flame.yaml` for a running cluster with session manager, object cache, executor manager, and the `flmrun` template application, run:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python -m flamepy.runner.e2e
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Installed wheels also provide:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
flamepy-runner-e2e
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The check packages a tiny temporary project and verifies Runner function calls, `ObjectFuture` chaining, and a stateful instance service. Use `--json` for machine-readable output and `--python-version 3.12` to verify a specific executor Python runtime.
|
|
50
|
+
|
|
51
|
+
## API Reference
|
|
52
|
+
|
|
53
|
+
### Session
|
|
54
|
+
|
|
55
|
+
Represents a computing session with application, e.g. Agent, Tools.
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
# Create a session
|
|
59
|
+
session = flamepy.create_session("my-app")
|
|
60
|
+
|
|
61
|
+
# Close a session
|
|
62
|
+
session.close()
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Task
|
|
66
|
+
|
|
67
|
+
Represents individual computing tasks within a session.
|
|
68
|
+
|
|
69
|
+
```python
|
|
70
|
+
from concurrent.futures import wait
|
|
71
|
+
|
|
72
|
+
# Run a task synchronously (blocks until complete)
|
|
73
|
+
result = session.invoke(b"input data")
|
|
74
|
+
|
|
75
|
+
# Run a task asynchronously (returns Future immediately)
|
|
76
|
+
future = session.run(b"input data")
|
|
77
|
+
result = future.result() # Wait for completion
|
|
78
|
+
|
|
79
|
+
# Run multiple tasks in parallel
|
|
80
|
+
futures = [session.run(f"input {i}".encode()) for i in range(10)]
|
|
81
|
+
wait(futures) # Wait for all tasks to complete
|
|
82
|
+
results = [f.result() for f in futures]
|
|
83
|
+
|
|
84
|
+
# Create a task and get task object
|
|
85
|
+
task = session.create_task(b"input data")
|
|
86
|
+
|
|
87
|
+
# Get task status
|
|
88
|
+
task = session.get_task(task.id)
|
|
89
|
+
|
|
90
|
+
# Watch task progress
|
|
91
|
+
for update in session.watch_task(task.id):
|
|
92
|
+
print(f"Task state: {update.state}")
|
|
93
|
+
if update.is_completed():
|
|
94
|
+
break
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Error Handling
|
|
98
|
+
|
|
99
|
+
The SDK provides custom exception types for different error scenarios:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from flamepy import FlameError, FlameErrorCode
|
|
103
|
+
|
|
104
|
+
try:
|
|
105
|
+
session = flamepy.create_session("flmping")
|
|
106
|
+
except FlameError as e:
|
|
107
|
+
if e.code == FlameErrorCode.INVALID_CONFIG:
|
|
108
|
+
print("Configuration error:", e.message)
|
|
109
|
+
elif e.code == FlameErrorCode.INVALID_STATE:
|
|
110
|
+
print("State error:", e.message)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Development
|
|
114
|
+
|
|
115
|
+
To set up the development environment:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Clone the repository
|
|
119
|
+
git clone https://github.com/xflops/flame.git
|
|
120
|
+
cd flame/sdk/python
|
|
121
|
+
|
|
122
|
+
# Install in development mode
|
|
123
|
+
# Note: Use --no-build-isolation if you have setuptools>=61.0 installed
|
|
124
|
+
python3 -m pip install -e . --user --no-build-isolation
|
|
125
|
+
|
|
126
|
+
# Or build and install the wheel
|
|
127
|
+
python3 -m build --wheel --no-isolation
|
|
128
|
+
python3 -m pip install dist/flamepy-0.6.0-py3-none-any.whl --user
|
|
129
|
+
|
|
130
|
+
# Install development dependencies
|
|
131
|
+
pip install -e .[dev]
|
|
132
|
+
|
|
133
|
+
# Run tests
|
|
134
|
+
pytest
|
|
135
|
+
|
|
136
|
+
# Format code
|
|
137
|
+
ruff format
|
|
138
|
+
|
|
139
|
+
# Type checking
|
|
140
|
+
mypy flamepy/
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Requirements
|
|
144
|
+
|
|
145
|
+
- Python >= 3.9
|
|
146
|
+
- setuptools >= 61.0 (for building from source)
|
|
147
|
+
|
|
148
|
+
### Troubleshooting
|
|
149
|
+
|
|
150
|
+
If you encounter issues with the package name showing as "UNKNOWN":
|
|
151
|
+
|
|
152
|
+
1. Make sure you have `setuptools>=61.0` installed:
|
|
153
|
+
```bash
|
|
154
|
+
python3 -m pip install --user --upgrade "setuptools>=61.0"
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
2. Clean any stale build artifacts:
|
|
158
|
+
```bash
|
|
159
|
+
rm -rf dist build src/flamepy.egg-info *.egg-info
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
3. Use `--no-build-isolation` flag when installing:
|
|
163
|
+
```bash
|
|
164
|
+
python3 -m pip install . --user --no-build-isolation
|
|
165
|
+
```
|
|
@@ -4,76 +4,89 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "flamepy"
|
|
7
|
-
version = "0.
|
|
8
|
-
description = "Python SDK for Flame distributed
|
|
7
|
+
version = "0.6.0"
|
|
8
|
+
description = "Python SDK for Flame, a distributed system for Agentic AI"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
requires-python = ">=3.
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
11
|
license-files = ["LICENSE"]
|
|
12
12
|
authors = [
|
|
13
13
|
{name = "XFLOPS Authors", email = "support@xflops.io"}
|
|
14
14
|
]
|
|
15
|
-
keywords = ["distributed
|
|
15
|
+
keywords = ["distributed system", "agentic ai", "flame", "sdk"]
|
|
16
16
|
classifiers = [
|
|
17
17
|
"Development Status :: 3 - Alpha",
|
|
18
18
|
"Intended Audience :: Developers",
|
|
19
19
|
"Operating System :: OS Independent",
|
|
20
20
|
"Programming Language :: Python :: 3",
|
|
21
|
-
"Programming Language :: Python :: 3.8",
|
|
22
21
|
"Programming Language :: Python :: 3.9",
|
|
23
22
|
"Programming Language :: Python :: 3.10",
|
|
24
23
|
"Programming Language :: Python :: 3.11",
|
|
24
|
+
"Programming Language :: Python :: 3.12",
|
|
25
25
|
]
|
|
26
26
|
dependencies = [
|
|
27
|
-
"grpcio>=1.
|
|
28
|
-
"grpcio-tools>=1.
|
|
29
|
-
"protobuf>=
|
|
27
|
+
"grpcio>=1.80",
|
|
28
|
+
"grpcio-tools>=1.80",
|
|
29
|
+
"protobuf>=6.31.0",
|
|
30
|
+
"pydantic>=2.11.0",
|
|
31
|
+
"fastapi>=0.115.0",
|
|
32
|
+
"uvicorn>=0.35.0",
|
|
33
|
+
"pyyaml>=6.0.0",
|
|
34
|
+
"pymongo>=4",
|
|
35
|
+
"requests >= 2.32",
|
|
36
|
+
"httpx >= 0.28",
|
|
37
|
+
"cloudpickle >= 3.1",
|
|
38
|
+
"pyarrow >= 18.1.0"
|
|
30
39
|
]
|
|
31
40
|
|
|
32
41
|
[project.optional-dependencies]
|
|
33
42
|
dev = [
|
|
34
43
|
"pytest>=7.0.0",
|
|
35
44
|
"pytest-asyncio>=0.21.0",
|
|
36
|
-
"
|
|
37
|
-
"isort>=5.0.0",
|
|
45
|
+
"ruff>=0.1.0",
|
|
38
46
|
"mypy>=1.0.0",
|
|
39
47
|
]
|
|
40
48
|
|
|
41
49
|
[tool.setuptools.packages.find]
|
|
42
|
-
where = [
|
|
43
|
-
|
|
44
|
-
]
|
|
50
|
+
where = ["src"]
|
|
51
|
+
include = ["flamepy*"]
|
|
52
|
+
exclude = ["tests*"]
|
|
45
53
|
|
|
46
54
|
[project.urls]
|
|
47
55
|
Homepage = "https://xflops.io"
|
|
48
56
|
Repository = "https://github.com/xflops/flame"
|
|
49
57
|
Issues = "https://github.com/xflops/flame/issues"
|
|
50
58
|
|
|
51
|
-
[
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
59
|
+
[project.scripts]
|
|
60
|
+
flamepy-runner-e2e = "flamepy.runner.e2e:main"
|
|
61
|
+
|
|
62
|
+
[tool.ruff]
|
|
63
|
+
line-length = 320
|
|
64
|
+
target-version = "py39"
|
|
65
|
+
exclude = [
|
|
66
|
+
".eggs",
|
|
67
|
+
".git",
|
|
68
|
+
".hg",
|
|
69
|
+
".mypy_cache",
|
|
70
|
+
".tox",
|
|
71
|
+
".venv",
|
|
72
|
+
"build",
|
|
73
|
+
"dist",
|
|
74
|
+
"src/flamepy/proto",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[tool.ruff.format]
|
|
78
|
+
quote-style = "double"
|
|
79
|
+
indent-style = "space"
|
|
68
80
|
|
|
69
|
-
[tool.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
[tool.ruff.lint]
|
|
82
|
+
select = ["E", "F", "I", "N", "W"]
|
|
83
|
+
ignore = []
|
|
84
|
+
|
|
85
|
+
[tool.ruff.lint.isort]
|
|
86
|
+
known-first-party = ["flamepy"]
|
|
74
87
|
|
|
75
88
|
[tool.mypy]
|
|
76
|
-
python_version = "3.
|
|
89
|
+
python_version = "3.9"
|
|
77
90
|
warn_return_any = true
|
|
78
91
|
warn_unused_configs = true
|
|
79
92
|
disallow_untyped_defs = true
|
|
@@ -95,3 +108,7 @@ module = [
|
|
|
95
108
|
]
|
|
96
109
|
ignore_missing_imports = true
|
|
97
110
|
|
|
111
|
+
[dependency-groups]
|
|
112
|
+
dev = [
|
|
113
|
+
"ruff>=0.1.0",
|
|
114
|
+
]
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright 2025 The Flame Authors.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
See the License for the specific language governing permissions and
|
|
11
|
+
limitations under the License.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
# ruff: noqa: E402, I001
|
|
15
|
+
# isort: skip_file
|
|
16
|
+
|
|
17
|
+
# Import proto module first to ensure types_pb2 is loaded before frontend_pb2
|
|
18
|
+
from flamepy import proto # noqa: F401
|
|
19
|
+
|
|
20
|
+
# Import submodules for runner, service, and util (only as submodules)
|
|
21
|
+
from . import runner, service, util
|
|
22
|
+
|
|
23
|
+
# Export all core classes/types at top level
|
|
24
|
+
from .core import ( # Type aliases; Constants; Enums; Exception classes; Data classes; Context and utility classes; Client functions; Client classes; Service constants; Service context classes; Service base classes; Service functions
|
|
25
|
+
DEFAULT_FLAME_CACHE_ENDPOINT,
|
|
26
|
+
DEFAULT_FLAME_CONF,
|
|
27
|
+
DEFAULT_FLAME_ENDPOINT,
|
|
28
|
+
FLAME_INSTANCE_ENDPOINT,
|
|
29
|
+
Application,
|
|
30
|
+
ApplicationAttributes,
|
|
31
|
+
ApplicationContext,
|
|
32
|
+
ApplicationID,
|
|
33
|
+
ApplicationSchema,
|
|
34
|
+
ApplicationState,
|
|
35
|
+
CommonData,
|
|
36
|
+
Connection,
|
|
37
|
+
Event,
|
|
38
|
+
FlameContext,
|
|
39
|
+
FlameContextRunner,
|
|
40
|
+
FlameError,
|
|
41
|
+
FlameErrorCode,
|
|
42
|
+
FlamePackage,
|
|
43
|
+
FlameService,
|
|
44
|
+
Message,
|
|
45
|
+
ObjectRef,
|
|
46
|
+
ResourceRequirement,
|
|
47
|
+
Session,
|
|
48
|
+
SessionAttributes,
|
|
49
|
+
SessionContext,
|
|
50
|
+
SessionID,
|
|
51
|
+
SessionState,
|
|
52
|
+
Shim,
|
|
53
|
+
Task,
|
|
54
|
+
TaskContext,
|
|
55
|
+
TaskID,
|
|
56
|
+
TaskInformer,
|
|
57
|
+
TaskInput,
|
|
58
|
+
TaskOutput,
|
|
59
|
+
TaskState,
|
|
60
|
+
TaskWatcher,
|
|
61
|
+
close_session,
|
|
62
|
+
connect,
|
|
63
|
+
create_session,
|
|
64
|
+
get_application,
|
|
65
|
+
get_object,
|
|
66
|
+
get_session,
|
|
67
|
+
list_applications,
|
|
68
|
+
list_executors,
|
|
69
|
+
list_nodes,
|
|
70
|
+
list_sessions,
|
|
71
|
+
open_session,
|
|
72
|
+
put_object,
|
|
73
|
+
register_application,
|
|
74
|
+
run,
|
|
75
|
+
unregister_application,
|
|
76
|
+
update_object,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
__version__ = "0.6.0"
|
|
80
|
+
|
|
81
|
+
__all__ = [
|
|
82
|
+
# Type aliases
|
|
83
|
+
"TaskID",
|
|
84
|
+
"SessionID",
|
|
85
|
+
"ApplicationID",
|
|
86
|
+
"Message",
|
|
87
|
+
"TaskInput",
|
|
88
|
+
"TaskOutput",
|
|
89
|
+
"CommonData",
|
|
90
|
+
# Constants
|
|
91
|
+
"DEFAULT_FLAME_CONF",
|
|
92
|
+
"DEFAULT_FLAME_ENDPOINT",
|
|
93
|
+
"DEFAULT_FLAME_CACHE_ENDPOINT",
|
|
94
|
+
# Enums
|
|
95
|
+
"SessionState",
|
|
96
|
+
"TaskState",
|
|
97
|
+
"ApplicationState",
|
|
98
|
+
"FlameErrorCode",
|
|
99
|
+
"Shim",
|
|
100
|
+
# Exception classes
|
|
101
|
+
"FlameError",
|
|
102
|
+
# Data classes
|
|
103
|
+
"Event",
|
|
104
|
+
"ResourceRequirement",
|
|
105
|
+
"SessionAttributes",
|
|
106
|
+
"ApplicationSchema",
|
|
107
|
+
"ApplicationAttributes",
|
|
108
|
+
"Task",
|
|
109
|
+
"Application",
|
|
110
|
+
"FlamePackage",
|
|
111
|
+
"FlameContextRunner",
|
|
112
|
+
# Context and utility classes
|
|
113
|
+
"TaskInformer",
|
|
114
|
+
"FlameContext",
|
|
115
|
+
# Client functions
|
|
116
|
+
"connect",
|
|
117
|
+
"create_session",
|
|
118
|
+
"open_session",
|
|
119
|
+
"register_application",
|
|
120
|
+
"unregister_application",
|
|
121
|
+
"list_applications",
|
|
122
|
+
"list_executors",
|
|
123
|
+
"list_nodes",
|
|
124
|
+
"get_application",
|
|
125
|
+
"list_sessions",
|
|
126
|
+
"get_session",
|
|
127
|
+
"close_session",
|
|
128
|
+
# Client classes
|
|
129
|
+
"Connection",
|
|
130
|
+
"Session",
|
|
131
|
+
"TaskWatcher",
|
|
132
|
+
# Service constants
|
|
133
|
+
"FLAME_INSTANCE_ENDPOINT",
|
|
134
|
+
# Service context classes
|
|
135
|
+
"ApplicationContext",
|
|
136
|
+
"SessionContext",
|
|
137
|
+
"TaskContext",
|
|
138
|
+
# Service base classes
|
|
139
|
+
"FlameService",
|
|
140
|
+
# Service functions
|
|
141
|
+
"run",
|
|
142
|
+
# Cache classes
|
|
143
|
+
"ObjectRef",
|
|
144
|
+
# Cache functions
|
|
145
|
+
"get_object",
|
|
146
|
+
"put_object",
|
|
147
|
+
"update_object",
|
|
148
|
+
# Submodules
|
|
149
|
+
"runner",
|
|
150
|
+
"service",
|
|
151
|
+
"util",
|
|
152
|
+
]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright 2025 The Flame Authors.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
See the License for the specific language governing permissions and
|
|
11
|
+
limitations under the License.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
# This makes the flamepy package executable as a module
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copyright 2025 The Flame Authors.
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
Unless required by applicable law or agreed to in writing, software
|
|
8
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
9
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
10
|
+
See the License for the specific language governing permissions and
|
|
11
|
+
limitations under the License.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from flamepy.core.cache import (
|
|
15
|
+
ObjectRef,
|
|
16
|
+
delete_objects,
|
|
17
|
+
get_object,
|
|
18
|
+
patch_object,
|
|
19
|
+
put_object,
|
|
20
|
+
update_object,
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
__all__ = [
|
|
24
|
+
"ObjectRef",
|
|
25
|
+
"delete_objects",
|
|
26
|
+
"get_object",
|
|
27
|
+
"patch_object",
|
|
28
|
+
"put_object",
|
|
29
|
+
"update_object",
|
|
30
|
+
]
|