uns-kit 0.2.1__tar.gz → 0.2.2__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 (63) hide show
  1. {uns_kit-0.2.1 → uns_kit-0.2.2}/PKG-INFO +11 -1
  2. {uns_kit-0.2.1 → uns_kit-0.2.2}/README.md +10 -0
  3. {uns_kit-0.2.1 → uns_kit-0.2.2}/pyproject.toml +1 -1
  4. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/cli.py +37 -0
  5. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/default/package.json +5 -0
  6. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/__init__.py +0 -0
  7. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/api/__init__.py +0 -0
  8. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/api/data_catalog.py +0 -0
  9. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/api/event_routing.py +0 -0
  10. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/api/interfaces.py +0 -0
  11. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/api/proxy.py +0 -0
  12. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/__init__.py +0 -0
  13. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/auth_client.py +0 -0
  14. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/client.py +0 -0
  15. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/config_file.py +0 -0
  16. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/config_schema.py +0 -0
  17. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/datahub_client.py +0 -0
  18. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/events.py +0 -0
  19. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/logger.py +0 -0
  20. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/packet.py +0 -0
  21. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/proxy.py +0 -0
  22. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/proxy_process.py +0 -0
  23. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/proxy_process_sync.py +0 -0
  24. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/runtime_metadata.py +0 -0
  25. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/secret_resolver.py +0 -0
  26. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/secure_store.py +0 -0
  27. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/status_monitor.py +0 -0
  28. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/topic_builder.py +0 -0
  29. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/topic_matcher.py +0 -0
  30. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/uns_mqtt_proxy.py +0 -0
  31. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/core/uns_path.py +0 -0
  32. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/cron/__init__.py +0 -0
  33. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/cron/proxy.py +0 -0
  34. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/database/__init__.py +0 -0
  35. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/database/client.py +0 -0
  36. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/database/params.py +0 -0
  37. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/database/schema.py +0 -0
  38. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/database/sql.py +0 -0
  39. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/database/types.py +0 -0
  40. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/service_bundle.py +0 -0
  41. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/api/src/api_routes.py +0 -0
  42. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/api/src/main.py +0 -0
  43. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/azure-pipelines.yml +0 -0
  44. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/cron/src/cron_example.py +0 -0
  45. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/data-offer/src/api_routes.py +0 -0
  46. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/data-offer/src/data_offers/__init__.py +0 -0
  47. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/data-offer/src/data_offers/demo_coils.py +0 -0
  48. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/data-offer/src/data_offers/demo_export.py +0 -0
  49. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/data-offer/src/data_offers/sql/demo_coils.sql +0 -0
  50. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/data-offer/src/data_offers/sql/demo_export.sql +0 -0
  51. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/data-offer/src/main.py +0 -0
  52. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/default/.gitignore +0 -0
  53. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/default/README.md +0 -0
  54. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/default/pyproject.toml +0 -0
  55. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/default/runtime.json +0 -0
  56. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/default/src/config/project_config_extension.example.py +0 -0
  57. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/default/src/config/project_config_extension.py +0 -0
  58. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/default/src/main.py +0 -0
  59. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/vscode/extensions.json +0 -0
  60. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/vscode/launch.json +0 -0
  61. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/vscode/settings.json +0 -0
  62. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/templates/workspace/workspace.json +0 -0
  63. {uns_kit-0.2.1 → uns_kit-0.2.2}/src/uns_kit/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uns-kit
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Lightweight Python UNS MQTT client (pub/sub + infra topics)
5
5
  License: MIT
6
6
  Author: Aljoša Vister
@@ -417,6 +417,8 @@ poetry install
417
417
  poetry run python src/main.py
418
418
  ```
419
419
 
420
+ The generated `package.json` declares `unsDatahub.kind: "addon"` and controller compatibility so tagged releases can be discovered by UNS Datahub controllers.
421
+
420
422
  To add optional feature scaffolding later:
421
423
  ```bash
422
424
  poetry run uns-kit-py configure-api .
@@ -424,6 +426,14 @@ poetry run uns-kit-py configure-cron .
424
426
  poetry run uns-kit-py configure-data-offer .
425
427
  ```
426
428
 
429
+ For an existing Python project, add the current non-destructive package metadata defaults with:
430
+
431
+ ```bash
432
+ poetry run uns-kit-py upgrade .
433
+ ```
434
+
435
+ The command adds the UNS Datahub add-on marker only when `unsDatahub` is absent and preserves existing metadata.
436
+
427
437
  `configure-api` adds a service-API scaffold:
428
438
  - `src/main.py`
429
439
  - `src/api_routes.py`
@@ -384,6 +384,8 @@ poetry install
384
384
  poetry run python src/main.py
385
385
  ```
386
386
 
387
+ The generated `package.json` declares `unsDatahub.kind: "addon"` and controller compatibility so tagged releases can be discovered by UNS Datahub controllers.
388
+
387
389
  To add optional feature scaffolding later:
388
390
  ```bash
389
391
  poetry run uns-kit-py configure-api .
@@ -391,6 +393,14 @@ poetry run uns-kit-py configure-cron .
391
393
  poetry run uns-kit-py configure-data-offer .
392
394
  ```
393
395
 
396
+ For an existing Python project, add the current non-destructive package metadata defaults with:
397
+
398
+ ```bash
399
+ poetry run uns-kit-py upgrade .
400
+ ```
401
+
402
+ The command adds the UNS Datahub add-on marker only when `unsDatahub` is absent and preserves existing metadata.
403
+
394
404
  `configure-api` adds a service-API scaffold:
395
405
  - `src/main.py`
396
406
  - `src/api_routes.py`
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "uns-kit"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  description = "Lightweight Python UNS MQTT client (pub/sub + infra topics)"
5
5
  authors = ["Aljoša Vister <aljosa.vister@gmail.com>"]
6
6
  license = "MIT"
@@ -29,6 +29,11 @@ from .version import __package_name__, __version__
29
29
 
30
30
 
31
31
  CLI_PROG_NAME = "uns-kit-py"
32
+ DEFAULT_UNS_DATAHUB_ADDON_METADATA = {
33
+ "schemaVersion": 1,
34
+ "kind": "addon",
35
+ "controllerCompatibility": ">=7.1 <8",
36
+ }
32
37
 
33
38
 
34
39
  def common_options(func):
@@ -226,6 +231,7 @@ def _scaffold_python_project(target_path: Path, project_name: str, *, allow_exis
226
231
  pkg_data = json.loads(pkg_path.read_text())
227
232
  pkg_data["name"] = project_name
228
233
  pkg_data["version"] = initial_app_version
234
+ _ensure_uns_datahub_addon_metadata(pkg_data)
229
235
  pkg_path.write_text(json.dumps(pkg_data, indent=2) + "\n")
230
236
  except Exception:
231
237
  pass
@@ -563,6 +569,36 @@ def configure_workspace(dest: str, overwrite: bool):
563
569
  _write_workspace_file(dest_path, overwrite)
564
570
 
565
571
 
572
+ @cli.command("upgrade", help="Update an existing UNS Python project to current conventions.")
573
+ @click.argument("dest", required=False, default=".")
574
+ def upgrade_project(dest: str) -> None:
575
+ dest_path = Path(dest).resolve()
576
+ pkg_path = dest_path / "package.json"
577
+ if not pkg_path.exists():
578
+ raise click.ClickException(f"package.json not found at {pkg_path}")
579
+
580
+ try:
581
+ pkg_data = json.loads(pkg_path.read_text())
582
+ except Exception as exc:
583
+ raise click.ClickException(f"Could not read {pkg_path}: {exc}") from exc
584
+ if not isinstance(pkg_data, dict):
585
+ raise click.ClickException(f"Expected a JSON object in {pkg_path}.")
586
+
587
+ changed = _ensure_uns_datahub_addon_metadata(pkg_data)
588
+ if changed:
589
+ pkg_path.write_text(json.dumps(pkg_data, indent=2) + "\n")
590
+ click.echo("Added package.json unsDatahub add-on metadata.")
591
+ else:
592
+ click.echo("Preserved existing package.json unsDatahub metadata.")
593
+
594
+
595
+ def _ensure_uns_datahub_addon_metadata(pkg_data: Dict[str, Any]) -> bool:
596
+ if "unsDatahub" in pkg_data:
597
+ return False
598
+ pkg_data["unsDatahub"] = dict(DEFAULT_UNS_DATAHUB_ADDON_METADATA)
599
+ return True
600
+
601
+
566
602
  def _configure_python_feature(
567
603
  dest_path: Path,
568
604
  *,
@@ -1199,6 +1235,7 @@ def render_cli_help(prog_name: str = CLI_PROG_NAME) -> str:
1199
1235
  " configure-devops [dir] Configure Azure DevOps tooling in an existing project\n"
1200
1236
  " configure-vscode [dir] Add VS Code workspace configuration files\n"
1201
1237
  " configure-workspace [dir] Create a VS Code workspace file\n"
1238
+ " upgrade [dir] Update an existing project to current conventions\n"
1202
1239
  " publish Publish a UNS data packet to a topic\n"
1203
1240
  " subscribe Subscribe to one or more topics (resilient)\n"
1204
1241
  " pull-request [dir] Create an Azure DevOps pull request for a Python project\n"
@@ -3,6 +3,11 @@
3
3
  "version": "__APP_VERSION__",
4
4
  "private": true,
5
5
  "description": "UNS Python application generated by uns-kit",
6
+ "unsDatahub": {
7
+ "schemaVersion": 1,
8
+ "kind": "addon",
9
+ "controllerCompatibility": ">=7.1 <8"
10
+ },
6
11
  "scripts": {
7
12
  "generate-config-schema": "poetry run uns-kit-py generate-config-schema"
8
13
  }
File without changes
File without changes