tinyfan 0.2.7__tar.gz → 0.2.9__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.
- {tinyfan-0.2.7 → tinyfan-0.2.9}/PKG-INFO +6 -5
- {tinyfan-0.2.7 → tinyfan-0.2.9}/README.md +1 -1
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/getting-started.py +9 -2
- {tinyfan-0.2.7 → tinyfan-0.2.9}/pyproject.toml +3 -2
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/codegen.py +37 -27
- {tinyfan-0.2.7 → tinyfan-0.2.9}/uv.lock +349 -315
- {tinyfan-0.2.7 → tinyfan-0.2.9}/.github/workflows/publish.yml +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/.gitignore +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/.python-version +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/README.md +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/configmap.yaml +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/configs.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/packaged/.python-version +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/packaged/Dockerfile +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/packaged/README.md +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/packaged/pyproject.toml +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/packaged/src/tinyfan_examples_packaged/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/packaged/src/tinyfan_examples_packaged/asset.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/resource.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/examples/secret.yaml +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/argo_typing.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/cli.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/config.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/dagviz.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/flow.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/flowrundata.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/py.typed +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/resources/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/resources/base.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/stores/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/stores/base.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/stores/bigquery.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/stores/gcs_pickle.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/stores/naive.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/utils/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/utils/embed.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/utils/exjson.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/utils/merge.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/utils/typing.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/src/tinyfan/utils/yaml.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/codegen_samples/directory/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/codegen_samples/directory/asset.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/codegen_samples/directory/asset2.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/codegen_samples/singlefile.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/conftest.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/helpers.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/openapi2jsonschema.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/test_codegen.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/test_config.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/test_decorators.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/utils/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/utils/embed_samples/directory/__init__.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/utils/embed_samples/directory/dep.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/utils/embed_samples/singlefile.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/utils/test_embed.py +0 -0
- {tinyfan-0.2.7 → tinyfan-0.2.9}/tests/utils/test_exjson.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tinyfan
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.9
|
|
4
4
|
Summary: Tiny Argo Workflows python devkit
|
|
5
5
|
Project-URL: Documentation, https://github.com/eunchuldev/tinyfan#readme
|
|
6
6
|
Project-URL: Issues, https://github.com/eunchuldev/tinyfan/issues
|
|
@@ -14,9 +14,9 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
15
|
Classifier: Typing :: Typed
|
|
16
16
|
Requires-Python: >=3.12
|
|
17
|
-
Requires-Dist: croniter>=
|
|
18
|
-
Requires-Dist: pyyaml>=6.0.
|
|
19
|
-
Requires-Dist: typer-slim>=0.
|
|
17
|
+
Requires-Dist: croniter>=6.0.0
|
|
18
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
19
|
+
Requires-Dist: typer-slim>=0.20.0
|
|
20
20
|
Provides-Extra: all
|
|
21
21
|
Requires-Dist: google-cloud-bigquery[pandas]; extra == 'all'
|
|
22
22
|
Requires-Dist: google-cloud-storage; extra == 'all'
|
|
@@ -40,6 +40,7 @@ Requires-Dist: pytest>=8.3.3; extra == 'dev'
|
|
|
40
40
|
Requires-Dist: ruff; extra == 'dev'
|
|
41
41
|
Requires-Dist: types-croniter; extra == 'dev'
|
|
42
42
|
Requires-Dist: types-jsonschema; extra == 'dev'
|
|
43
|
+
Requires-Dist: types-networkx; extra == 'dev'
|
|
43
44
|
Requires-Dist: types-pyyaml; extra == 'dev'
|
|
44
45
|
Provides-Extra: gcs
|
|
45
46
|
Requires-Dist: google-cloud-storage; extra == 'gcs'
|
|
@@ -99,7 +100,7 @@ def greeting(world: str):
|
|
|
99
100
|
```shell
|
|
100
101
|
# Apply the changes to argo workflow
|
|
101
102
|
|
|
102
|
-
tinyfan
|
|
103
|
+
tinyfan main.py | kubectl apply -f -
|
|
103
104
|
```
|
|
104
105
|
|
|
105
106
|
# Real World Example (still tiny though!)
|
|
@@ -9,9 +9,16 @@ def target() -> str:
|
|
|
9
9
|
return "world"
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
@tinyfan.asset(
|
|
13
|
+
schedule="*/1 * * * *",
|
|
14
|
+
)
|
|
15
|
+
def target2() -> str:
|
|
16
|
+
return "earth"
|
|
17
|
+
|
|
18
|
+
|
|
12
19
|
@tinyfan.asset()
|
|
13
|
-
def greeting(target: str):
|
|
14
|
-
print("hello " + target)
|
|
20
|
+
def greeting(target: str, target2: str):
|
|
21
|
+
print("hello " + target, "hello " + target2)
|
|
15
22
|
|
|
16
23
|
|
|
17
24
|
@tinyfan.asset(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tinyfan"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.9"
|
|
4
4
|
description = 'Tiny Argo Workflows python devkit'
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.12"
|
|
@@ -14,7 +14,7 @@ classifiers = [
|
|
|
14
14
|
"Programming Language :: Python :: 3.12",
|
|
15
15
|
"Typing :: Typed",
|
|
16
16
|
]
|
|
17
|
-
dependencies = ["croniter>=
|
|
17
|
+
dependencies = ["croniter>=6.0.0", "pyyaml>=6.0.3", "typer-slim>=0.20.0"]
|
|
18
18
|
|
|
19
19
|
[project.scripts]
|
|
20
20
|
tinyfan = "tinyfan.cli:main"
|
|
@@ -34,6 +34,7 @@ dev = [
|
|
|
34
34
|
"types-PyYAML",
|
|
35
35
|
"types-jsonschema",
|
|
36
36
|
"types-croniter",
|
|
37
|
+
"types-networkx",
|
|
37
38
|
"tinyfan[all]",
|
|
38
39
|
]
|
|
39
40
|
|
|
@@ -229,11 +229,11 @@ class AssetTree:
|
|
|
229
229
|
root_location = get_root_path(list(self.nodes.values())[0].asset.func)
|
|
230
230
|
source += embed(root_location)
|
|
231
231
|
if not root_location.endswith(".py"):
|
|
232
|
-
source += """{{=join(map(fromJSON(inputs.parameters.moduledata), {"from " + .module + " import " + .name}), "
|
|
232
|
+
source += """{{=join(map(fromJSON(inputs.parameters.moduledata), {"from " + .module + " import " + .name}), ";")}}\n"""
|
|
233
233
|
source += "asset = {{inputs.parameters.asset_name}}.asset\n"
|
|
234
234
|
else:
|
|
235
235
|
source = (
|
|
236
|
-
"""{{=join(map(fromJSON(inputs.parameters.moduledata), {"from " + .module + " import " + .name}), "
|
|
236
|
+
"""{{=join(map(fromJSON(inputs.parameters.moduledata), {"from " + .module + " import " + .name}), ";")}}\n"""
|
|
237
237
|
"asset = {{inputs.parameters.asset_name}}.asset\n"
|
|
238
238
|
)
|
|
239
239
|
source += (
|
|
@@ -257,28 +257,33 @@ class AssetTree:
|
|
|
257
257
|
"generateName": f"""{self.flow.name}-{encode_schedule_to_k8sname(tz, schedule)}-""",
|
|
258
258
|
},
|
|
259
259
|
"spec": {
|
|
260
|
-
"
|
|
260
|
+
"schedules": [schedule],
|
|
261
261
|
"timezone": tz,
|
|
262
262
|
"workflowSpec": {
|
|
263
263
|
"entrypoint": "flow",
|
|
264
264
|
**dropnone({"serviceAccountName": serviceAccountName or self.flow.serviceAccountName}),
|
|
265
|
-
|
|
265
|
+
**dropnone(
|
|
266
266
|
{
|
|
267
|
-
"
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
267
|
+
"podSpecPatch": (container or self.flow.container)
|
|
268
|
+
and yaml_dump(
|
|
269
|
+
{
|
|
270
|
+
"containers": [
|
|
271
|
+
deepmerge(
|
|
272
272
|
{
|
|
273
|
-
"name": "
|
|
274
|
-
"
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
273
|
+
"name": "main",
|
|
274
|
+
"env": [
|
|
275
|
+
{
|
|
276
|
+
"name": "TINYFAN_SOURCE",
|
|
277
|
+
"value": source,
|
|
278
|
+
}
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
container or {},
|
|
282
|
+
self.flow.container or {},
|
|
283
|
+
)
|
|
284
|
+
]
|
|
285
|
+
}
|
|
286
|
+
)
|
|
282
287
|
}
|
|
283
288
|
),
|
|
284
289
|
"templates": [
|
|
@@ -339,16 +344,21 @@ class AssetTree:
|
|
|
339
344
|
self.flow.container or {},
|
|
340
345
|
node.asset.container or {},
|
|
341
346
|
),
|
|
342
|
-
|
|
347
|
+
**dropnone(
|
|
343
348
|
{
|
|
344
|
-
"
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
349
|
+
"podSpecPatch": node.asset.container
|
|
350
|
+
and yaml_dump(
|
|
351
|
+
{
|
|
352
|
+
"containers": [
|
|
353
|
+
deepmerge(
|
|
354
|
+
{
|
|
355
|
+
"name": "main",
|
|
356
|
+
},
|
|
357
|
+
node.asset.container,
|
|
358
|
+
)
|
|
359
|
+
]
|
|
360
|
+
}
|
|
361
|
+
),
|
|
352
362
|
}
|
|
353
363
|
),
|
|
354
364
|
"synchronization": {
|