jac-scale 0.1.4__py3-none-any.whl → 0.1.5__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.
- jac_scale/impl/serve.impl.jac +12 -5
- jac_scale/targets/kubernetes/utils/kubernetes_utils.impl.jac +8 -7
- jac_scale/tests/fixtures/scale-feats/components/Button.cl.jac +1 -1
- {jac_scale-0.1.4.dist-info → jac_scale-0.1.5.dist-info}/METADATA +2 -2
- {jac_scale-0.1.4.dist-info → jac_scale-0.1.5.dist-info}/RECORD +8 -8
- {jac_scale-0.1.4.dist-info → jac_scale-0.1.5.dist-info}/WHEEL +0 -0
- {jac_scale-0.1.4.dist-info → jac_scale-0.1.5.dist-info}/entry_points.txt +0 -0
- {jac_scale-0.1.4.dist-info → jac_scale-0.1.5.dist-info}/top_level.txt +0 -0
jac_scale/impl/serve.impl.jac
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import from jaclang.cli.console { console }
|
|
2
|
+
import from jaclang.cli.banners { JAC_DISCORD_URL }
|
|
3
|
+
|
|
1
4
|
"""Helper function to convert TransportResponse to dict for JSONResponse."""
|
|
2
5
|
def _transport_response_to_dict(
|
|
3
6
|
transport_response: TransportResponse
|
|
@@ -65,7 +68,6 @@ impl JacAPIServer.start(dev: bool = False, no_client: bool = False) -> None {
|
|
|
65
68
|
if client_exports {
|
|
66
69
|
import time;
|
|
67
70
|
import sys;
|
|
68
|
-
import from jaclang.cli.console { console }
|
|
69
71
|
start_time = time.time();
|
|
70
72
|
try {
|
|
71
73
|
with console.status(
|
|
@@ -84,6 +86,11 @@ impl JacAPIServer.start(dev: bool = False, no_client: bool = False) -> None {
|
|
|
84
86
|
style="muted",
|
|
85
87
|
file=sys.stderr
|
|
86
88
|
);
|
|
89
|
+
console.info('Try again after running: jac clean --all', emoji=True);
|
|
90
|
+
console.info(
|
|
91
|
+
f'If it still doesn\'t work, ask for help at {JAC_DISCORD_URL}',
|
|
92
|
+
emoji=True
|
|
93
|
+
);
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
96
|
}
|
|
@@ -471,7 +478,7 @@ impl JacAPIServer.render_page_callback -> Callable[..., HTMLResponse] {
|
|
|
471
478
|
} except ValueError as exc {
|
|
472
479
|
return HTMLResponse(content=f"<h1>404 Not Found</h1>", status_code=404);
|
|
473
480
|
} except RuntimeError as exc {
|
|
474
|
-
print(f"Error rendering page '{page_name}': {exc}");
|
|
481
|
+
console.print(f"Error rendering page '{page_name}': {exc}");
|
|
475
482
|
return HTMLResponse(
|
|
476
483
|
content=f"<h1>503 Service Unavailable</h1>", status_code=503
|
|
477
484
|
);
|
|
@@ -494,7 +501,7 @@ impl JacAPIServer.render_base_route_callback(
|
|
|
494
501
|
} except ValueError as exc {
|
|
495
502
|
return HTMLResponse(content=f"<h1>404 Not Found</h1>", status_code=404);
|
|
496
503
|
} except RuntimeError as exc {
|
|
497
|
-
print(f"Error rendering base route app '{app_name}': {exc}");
|
|
504
|
+
console.print(f"Error rendering base route app '{app_name}': {exc}");
|
|
498
505
|
return HTMLResponse(
|
|
499
506
|
content=f"<h1>503 Service Unavailable</h1>", status_code=503
|
|
500
507
|
);
|
|
@@ -602,7 +609,7 @@ impl JacAPIServer.create_function_callback(
|
|
|
602
609
|
);
|
|
603
610
|
}
|
|
604
611
|
}
|
|
605
|
-
print(f"Executing function '{func_name}' with params: {kwargs}");
|
|
612
|
+
console.print(f"Executing function '{func_name}' with params: {kwargs}");
|
|
606
613
|
result = await self.execution_manager.execute_function(
|
|
607
614
|
self.get_functions()[func_name], kwargs, (username or '__guest__')
|
|
608
615
|
);
|
|
@@ -888,7 +895,7 @@ impl JacAPIServer.create_user(username: str, password: str) -> TransportResponse
|
|
|
888
895
|
);
|
|
889
896
|
} except Exception as e {
|
|
890
897
|
error_trace = traceback.format_exc();
|
|
891
|
-
print(f"Error in create_user: {e}\n{error_trace}");
|
|
898
|
+
console.print(f"Error in create_user: {e}\n{error_trace}");
|
|
892
899
|
return TransportResponse.fail(
|
|
893
900
|
code='INTERNAL_ERROR',
|
|
894
901
|
message=f"Registration failed: {e}",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os;
|
|
2
2
|
import pathlib;
|
|
3
|
+
import from jaclang.cli.console { console }
|
|
3
4
|
|
|
4
5
|
impl parse_cpu_quantity(quantity: str) -> float {
|
|
5
6
|
trimmed = quantity.strip();
|
|
@@ -183,7 +184,7 @@ impl sync_code_to_pvc(
|
|
|
183
184
|
cwd=code_folder
|
|
184
185
|
);
|
|
185
186
|
} else {
|
|
186
|
-
print("jac.toml file not found");
|
|
187
|
+
console.print("jac.toml file not found");
|
|
187
188
|
}
|
|
188
189
|
} finally {
|
|
189
190
|
temp_tar_path.unlink(missing_ok=True);
|
|
@@ -368,12 +369,12 @@ impl check_deployment_status(
|
|
|
368
369
|
try {
|
|
369
370
|
response = requests.get(url, timeout=10);
|
|
370
371
|
if (response.status_code == 200) {
|
|
371
|
-
print(f"Service is available at: {url}");
|
|
372
|
+
console.print(f"Service is available at: {url}");
|
|
372
373
|
return True;
|
|
373
374
|
}
|
|
374
375
|
} except RequestException as e {
|
|
375
376
|
if (attempt == max_retries) {
|
|
376
|
-
print(f"Failed to connect to {url}: {e}");
|
|
377
|
+
console.print(f"Failed to connect to {url}: {e}");
|
|
377
378
|
}
|
|
378
379
|
}
|
|
379
380
|
if (attempt < max_retries) {
|
|
@@ -436,10 +437,10 @@ impl ensure_namespace_exists(namespace: str) -> None {
|
|
|
436
437
|
config.load_kube_config();
|
|
437
438
|
core_v1 = client.CoreV1Api();
|
|
438
439
|
core_v1.read_namespace(name=namespace);
|
|
439
|
-
print(f"Namespace '{namespace}' already exists.");
|
|
440
|
+
console.print(f"Namespace '{namespace}' already exists.");
|
|
440
441
|
} except ApiException as e {
|
|
441
442
|
if (e.status == 404) {
|
|
442
|
-
print(f"Namespace '{namespace}' not found. Creating it...");
|
|
443
|
+
console.print(f"Namespace '{namespace}' not found. Creating it...");
|
|
443
444
|
core_v1.create_namespace(
|
|
444
445
|
body={
|
|
445
446
|
'apiVersion': 'v1',
|
|
@@ -447,7 +448,7 @@ impl ensure_namespace_exists(namespace: str) -> None {
|
|
|
447
448
|
'metadata': {'name': namespace}
|
|
448
449
|
}
|
|
449
450
|
);
|
|
450
|
-
print(f"Namespace '{namespace}' created successfully.");
|
|
451
|
+
console.print(f"Namespace '{namespace}' created successfully.");
|
|
451
452
|
} else {
|
|
452
453
|
raise ;
|
|
453
454
|
}
|
|
@@ -514,6 +515,6 @@ impl load_env_variables(code_folder: str) -> list {
|
|
|
514
515
|
"""
|
|
515
516
|
impl debug_print(statement: str, debug_only: bool = False) -> None {
|
|
516
517
|
if debug_only {
|
|
517
|
-
print(statement);
|
|
518
|
+
console.print(statement);
|
|
518
519
|
}
|
|
519
520
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Button component for the Jac client application."""
|
|
2
2
|
|
|
3
|
-
def:pub Button(label: str, onClick: any, variant: str = "primary", disabled: bool = False) ->
|
|
3
|
+
def:pub Button(label: str, onClick: any, variant: str = "primary", disabled: bool = False) -> JsxElement {
|
|
4
4
|
base_styles = {
|
|
5
5
|
"padding": "0.75rem 1.5rem",
|
|
6
6
|
"fontSize": "1rem",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: jac-scale
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Author-email: Jason Mars <jason@mars.ninja>
|
|
5
5
|
Requires-Python: >=3.12
|
|
6
6
|
Description-Content-Type: text/markdown
|
|
7
|
-
Requires-Dist: jaclang>=0.9.
|
|
7
|
+
Requires-Dist: jaclang>=0.9.14
|
|
8
8
|
Requires-Dist: python-dotenv<2.0.0,>=1.2.1
|
|
9
9
|
Requires-Dist: docker<8.0.0,>=7.1.0
|
|
10
10
|
Requires-Dist: kubernetes<35.0.0,>=34.1.0
|
|
@@ -28,7 +28,7 @@ jac_scale/impl/context.impl.jac,sha256=3M33iA9L2SCIMT0rQTvb8MkveNCuTEjc7rNknK4Hr
|
|
|
28
28
|
jac_scale/impl/memory_hierarchy.main.impl.jac,sha256=Jc4Cy-5cy0TtK2uQ6rdYruxa0ZfZKSYgo3jOoXv4ER4,2339
|
|
29
29
|
jac_scale/impl/memory_hierarchy.mongo.impl.jac,sha256=APh7YloOj7bWGtv6DTBm7ekX13w_fectbZiFY0btwWU,6626
|
|
30
30
|
jac_scale/impl/memory_hierarchy.redis.impl.jac,sha256=x27TzeBI87vz72s7esQvFz8EPk3EfhVMNKU8sP4s2hk,4900
|
|
31
|
-
jac_scale/impl/serve.impl.jac,sha256=
|
|
31
|
+
jac_scale/impl/serve.impl.jac,sha256=lnie5RoWSCeERNcRPdp3bV_ElZCLNPVyybajJuWa2MQ,86091
|
|
32
32
|
jac_scale/impl/user_manager.impl.jac,sha256=7xGoLMweQuoVW-na7XbK3bctfUHaSEnT9nB7DLgSlgw,11817
|
|
33
33
|
jac_scale/impl/webhook.impl.jac,sha256=87IZn9nfSaNXX9RYXVJRJEz-3xzznpC6RhVBoJJA2X8,7504
|
|
34
34
|
jac_scale/jserver/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -41,7 +41,7 @@ jac_scale/providers/database/kubernetes_redis.jac,sha256=qF9HkNLLgiymxiCXbmETbVV
|
|
|
41
41
|
jac_scale/providers/registry/dockerhub.jac,sha256=7KlgQJGGUeDF7zP8-KNF8HTShB4td1946OtIdS57EHI,2282
|
|
42
42
|
jac_scale/targets/kubernetes/kubernetes_config.jac,sha256=Xk3EjKTEjptlctD2C5cTYjgw9V8i8mfsO-jKAa2IZZs,9406
|
|
43
43
|
jac_scale/targets/kubernetes/kubernetes_target.jac,sha256=itICKs_sA4jOs7_wrFgpj5QhupjKVXRSvkaJMBL6t9g,35523
|
|
44
|
-
jac_scale/targets/kubernetes/utils/kubernetes_utils.impl.jac,sha256=
|
|
44
|
+
jac_scale/targets/kubernetes/utils/kubernetes_utils.impl.jac,sha256=m5WV0oxIthbb7EVVd2vnVinp9q_-RMuGup-5H2X3viM,15856
|
|
45
45
|
jac_scale/targets/kubernetes/utils/kubernetes_utils.jac,sha256=Nr257oCyduodJbxkLJeNYphFzz9NxviFfW1Tpc5dQKk,2129
|
|
46
46
|
jac_scale/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
47
47
|
jac_scale/tests/conftest.py,sha256=uiS352_HVmMf7V6T0BZl-Kn8svkKbj3jhNr-hEKrcPw,820
|
|
@@ -61,10 +61,10 @@ jac_scale/tests/fixtures/test_api.jac,sha256=aqfvy4wgc0qPTM9_NYvXUcpemNTSdwW0tp4
|
|
|
61
61
|
jac_scale/tests/fixtures/test_restspec.jac,sha256=oFqACGtuoGz1xsURAaeXrQe7hkMI-W8hL5IKFDTQHKU,2511
|
|
62
62
|
jac_scale/tests/fixtures/todo_app.jac,sha256=beI6AiRutmXsXxuzU9nIZTE-AuoBBP-WqbRA2ux1pN4,1216
|
|
63
63
|
jac_scale/tests/fixtures/scale-feats/main.jac,sha256=QN8Opodha9jLWdRGCASByIogePr1XKphgKjyE9Pp73c,4205
|
|
64
|
-
jac_scale/tests/fixtures/scale-feats/components/Button.cl.jac,sha256=
|
|
64
|
+
jac_scale/tests/fixtures/scale-feats/components/Button.cl.jac,sha256=bauX10lsZWYS9-bGhGGMkAswelwu_libRGkkeW0R6tM,910
|
|
65
65
|
jac_scale/utilities/loggers/standard_logger.jac,sha256=6XL5ETAOBwbsFCOp0VN_7TOnqcQDmbLZVzubA-JR3vA,1376
|
|
66
|
-
jac_scale-0.1.
|
|
67
|
-
jac_scale-0.1.
|
|
68
|
-
jac_scale-0.1.
|
|
69
|
-
jac_scale-0.1.
|
|
70
|
-
jac_scale-0.1.
|
|
66
|
+
jac_scale-0.1.5.dist-info/METADATA,sha256=TSnie4KQTg5HMYKpM7cU_kuCpAkhtBoQUF4K6icOEoM,20491
|
|
67
|
+
jac_scale-0.1.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
68
|
+
jac_scale-0.1.5.dist-info/entry_points.txt,sha256=n-Wm8JEtGOqy_IY_kgIOi3-uYnuVK-iWsvKiLkxlG4E,105
|
|
69
|
+
jac_scale-0.1.5.dist-info/top_level.txt,sha256=PpgR0R8z9qoFbSser2K20r5Is4K6TxVwguoN6LfTEKU,10
|
|
70
|
+
jac_scale-0.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|