llama-deploy-appserver 0.4.0__tar.gz → 0.4.1__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.
Files changed (24) hide show
  1. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/PKG-INFO +2 -2
  2. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/pyproject.toml +2 -2
  3. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/app.py +26 -3
  4. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/workflow_loader.py +20 -8
  5. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/README.md +0 -0
  6. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/__init__.py +0 -0
  7. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/bootstrap.py +0 -0
  8. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/configure_logging.py +0 -0
  9. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/correlation_id.py +0 -0
  10. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/deployment.py +0 -0
  11. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/deployment_config_parser.py +0 -0
  12. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/interrupts.py +0 -0
  13. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/process_utils.py +0 -0
  14. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/py.typed +0 -0
  15. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/routers/__init__.py +0 -0
  16. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/routers/deployments.py +0 -0
  17. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/routers/status.py +0 -0
  18. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/routers/ui_proxy.py +0 -0
  19. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/settings.py +0 -0
  20. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/stats.py +0 -0
  21. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/types.py +0 -0
  22. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/workflow_store/agent_data_store.py +0 -0
  23. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/workflow_store/keyed_lock.py +0 -0
  24. {llama_deploy_appserver-0.4.0 → llama_deploy_appserver-0.4.1}/src/llama_deploy/appserver/workflow_store/lru_cache.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: llama-deploy-appserver
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Application server components for LlamaDeploy
5
5
  Author: Massimiliano Pippi, Adrian Lyjak
6
6
  Author-email: Massimiliano Pippi <mpippi@gmail.com>, Adrian Lyjak <adrianlyjak@gmail.com>
@@ -9,7 +9,7 @@ Requires-Dist: llama-index-workflows[server]>=2.12.0,<2.13.0
9
9
  Requires-Dist: pydantic-settings>=2.10.1
10
10
  Requires-Dist: fastapi>=0.100.0
11
11
  Requires-Dist: websockets>=12.0
12
- Requires-Dist: llama-deploy-core>=0.4.0,<0.5.0
12
+ Requires-Dist: llama-deploy-core>=0.4.1,<0.5.0
13
13
  Requires-Dist: httpx>=0.24.0,<1.0.0
14
14
  Requires-Dist: prometheus-fastapi-instrumentator>=7.1.0
15
15
  Requires-Dist: packaging>=25.0
@@ -14,7 +14,7 @@ dev = [
14
14
 
15
15
  [project]
16
16
  name = "llama-deploy-appserver"
17
- version = "0.4.0"
17
+ version = "0.4.1"
18
18
  description = "Application server components for LlamaDeploy"
19
19
  readme = "README.md"
20
20
  license = {text = "MIT"}
@@ -28,7 +28,7 @@ dependencies = [
28
28
  "pydantic-settings>=2.10.1",
29
29
  "fastapi>=0.100.0",
30
30
  "websockets>=12.0",
31
- "llama-deploy-core>=0.4.0,<0.5.0",
31
+ "llama-deploy-core>=0.4.1,<0.5.0",
32
32
  "httpx>=0.24.0,<1.0.0",
33
33
  "prometheus-fastapi-instrumentator>=7.1.0",
34
34
  "packaging>=25.0",
@@ -173,13 +173,14 @@ def prepare_server(
173
173
  install: bool = False,
174
174
  build: bool = False,
175
175
  install_ui_deps: bool = True,
176
+ skip_env_validation: bool = False,
176
177
  ) -> None:
177
178
  configure_settings(
178
179
  deployment_file_path=deployment_file or Path(DEFAULT_DEPLOYMENT_FILE_PATH)
179
180
  )
180
181
  cfg = get_deployment_config()
181
182
  load_environment_variables(cfg, settings.resolved_config_parent)
182
- validate_required_env_vars(cfg)
183
+ validate_required_env_vars(cfg, fill_missing=skip_env_validation)
183
184
  if install:
184
185
  config = get_deployment_config()
185
186
  inject_appserver_into_target(config, settings.resolved_config_parent)
@@ -298,10 +299,16 @@ def start_server_in_target_venv(
298
299
  def start_preflight_in_target_venv(
299
300
  cwd: Path | None = None,
300
301
  deployment_file: Path | None = None,
302
+ skip_env_validation: bool = False,
301
303
  ) -> None:
302
304
  """
303
305
  Run preflight validation inside the target project's virtual environment using uv.
304
306
  Mirrors the venv targeting and invocation strategy used by start_server_in_target_venv.
307
+
308
+ Args:
309
+ cwd: Working directory for the validation.
310
+ deployment_file: Path to the deployment configuration file.
311
+ skip_env_validation: If True, skip validation of required environment variables.
305
312
  """
306
313
  configure_settings(
307
314
  app_root=cwd,
@@ -320,6 +327,8 @@ def start_preflight_in_target_venv(
320
327
  ]
321
328
  if deployment_file:
322
329
  args.extend(["--deployment-file", str(deployment_file)])
330
+ if skip_env_validation:
331
+ args.append("--skip-env-validation")
323
332
 
324
333
  run_process(
325
334
  args,
@@ -386,10 +395,19 @@ def preflight_validate(
386
395
  cwd: Path | None = None,
387
396
  deployment_file: Path | None = None,
388
397
  configure_logging: bool = False,
398
+ skip_env_validation: bool = False,
389
399
  ) -> None:
390
400
  """
391
401
  Perform the same initialization path as starting the server, without serving.
392
402
  This catches import errors and runs workflow validations.
403
+
404
+ Args:
405
+ cwd: Working directory for the validation.
406
+ deployment_file: Path to the deployment configuration file.
407
+ configure_logging: Whether to configure logging.
408
+ skip_env_validation: If True, fill missing required env vars with placeholder
409
+ values instead of raising an error. Useful when validating workflow structure
410
+ without actual environment variable values.
393
411
  """
394
412
  configure_settings(
395
413
  app_root=cwd,
@@ -397,7 +415,7 @@ def preflight_validate(
397
415
  )
398
416
  cfg = get_deployment_config()
399
417
  load_environment_variables(cfg, settings.resolved_config_parent)
400
- validate_required_env_vars(cfg)
418
+ validate_required_env_vars(cfg, fill_missing=skip_env_validation)
401
419
 
402
420
  workflows = load_workflows(cfg)
403
421
  # Instantiate Deployment to ensure server wiring doesn't raise
@@ -454,12 +472,17 @@ if __name__ == "__main__":
454
472
  parser.add_argument("--deployment-file", type=Path)
455
473
  parser.add_argument("--open-browser", action="store_true")
456
474
  parser.add_argument("--preflight", action="store_true")
475
+ parser.add_argument("--skip-env-validation", action="store_true")
457
476
  parser.add_argument("--export-json-graph", action="store_true")
458
477
  parser.add_argument("--export-output", type=Path)
459
478
 
460
479
  args = parser.parse_args()
461
480
  if args.preflight:
462
- preflight_validate(cwd=Path.cwd(), deployment_file=args.deployment_file)
481
+ preflight_validate(
482
+ cwd=Path.cwd(),
483
+ deployment_file=args.deployment_file,
484
+ skip_env_validation=args.skip_env_validation,
485
+ )
463
486
  elif args.export_json_graph:
464
487
  export_json_graph(
465
488
  cwd=Path.cwd(),
@@ -73,25 +73,37 @@ def load_environment_variables(config: DeploymentConfig, source_root: Path) -> N
73
73
  os.environ[key] = value
74
74
 
75
75
 
76
- def validate_required_env_vars(config: DeploymentConfig) -> None:
76
+ def validate_required_env_vars(
77
+ config: DeploymentConfig, *, fill_missing: bool = False
78
+ ) -> None:
77
79
  """
78
80
  Validate that all required environment variables are present and non-empty.
79
81
 
82
+ Args:
83
+ config: The deployment configuration containing required_env_vars.
84
+ fill_missing: If True, fill missing env vars with placeholder values instead
85
+ of raising an error. This is useful for validation where env vars may be
86
+ read statically during import time.
87
+
80
88
  Raises:
81
- RuntimeError: If any required env vars are missing or empty.
89
+ RuntimeError: If any required env vars are missing or empty and fill_missing is False.
82
90
  """
83
91
  required = config.required_env_vars
84
92
  if not required:
85
93
  return
86
94
  missing = [name for name in required if not os.environ.get(name)]
87
95
  if missing:
88
- missing_list = ", ".join(sorted(missing))
89
- raise RuntimeError(
90
- (
91
- "Missing required environment variables defined in required_env_vars: "
92
- f"{missing_list}. Provide them via your environment, .env files, or the deployment secrets."
96
+ if fill_missing:
97
+ for name in missing:
98
+ os.environ[name] = f"__PLACEHOLDER_{name}__"
99
+ else:
100
+ missing_list = ", ".join(sorted(missing))
101
+ raise RuntimeError(
102
+ (
103
+ "Missing required environment variables defined in required_env_vars: "
104
+ f"{missing_list}. Provide them via your environment, .env files, or the deployment secrets."
105
+ )
93
106
  )
94
- )
95
107
 
96
108
 
97
109
  def parse_environment_variables(