pragmatiks-cli 16.3.2__tar.gz → 16.3.3__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. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/PKG-INFO +2 -2
  2. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/pyproject.toml +3 -3
  3. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/pyproject.toml.orig +3 -3
  4. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/provider_publish.py +43 -20
  5. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/providers.py +17 -1
  6. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/README.md +0 -0
  7. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/__init__.py +0 -0
  8. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/__init__.py +0 -0
  9. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/auth.py +0 -0
  10. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/completions.py +0 -0
  11. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/config.py +0 -0
  12. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/organizations.py +0 -0
  13. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/projects.py +0 -0
  14. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/provider_output.py +0 -0
  15. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/commands/resources.py +0 -0
  16. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/config.py +0 -0
  17. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/errors.py +0 -0
  18. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/exit_codes.py +0 -0
  19. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/helpers.py +0 -0
  20. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/main.py +0 -0
  21. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/plugins.py +0 -0
  22. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/project_context.py +0 -0
  23. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/py.typed +0 -0
  24. {pragmatiks_cli-16.3.2 → pragmatiks_cli-16.3.3}/src/pragma_cli/teardown.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pragmatiks-cli
3
- Version: 16.3.2
3
+ Version: 16.3.3
4
4
  Summary: Command-line interface for Pragmatiks
5
5
  Requires-Dist: typer>=0.15.3
6
- Requires-Dist: pragmatiks-sdk>=25.1.0
6
+ Requires-Dist: pragmatiks-sdk>=25.2.0
7
7
  Requires-Dist: pyyaml>=6.0.3
8
8
  Requires-Dist: copier>=9.0.0
9
9
  Requires-Dist: rich>=13.9.0
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "pragmatiks-cli"
3
- version = "16.3.2"
3
+ version = "16.3.3"
4
4
  description = "Command-line interface for Pragmatiks"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
7
7
  dependencies = [
8
8
  "typer>=0.15.3",
9
- "pragmatiks-sdk>=25.1.0",
9
+ "pragmatiks-sdk>=25.2.0",
10
10
  "pyyaml>=6.0.3",
11
11
  "copier>=9.0.0",
12
12
  "rich>=13.9.0",
@@ -55,7 +55,7 @@ exclude = ["**/__pycache__/**"]
55
55
 
56
56
  [tool.commitizen]
57
57
  name = "cz_conventional_commits"
58
- version = "16.3.2"
58
+ version = "16.3.3"
59
59
  version_files = ["pyproject.toml:^version"]
60
60
  tag_format = "v$version"
61
61
  bump_message = "bump: version $current_version → $new_version [skip ci]"
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "pragmatiks-cli"
3
- version = "16.3.2"
3
+ version = "16.3.3"
4
4
  description = "Command-line interface for Pragmatiks"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
7
7
  dependencies = [
8
8
  "typer>=0.15.3",
9
- "pragmatiks-sdk>=25.1.0",
9
+ "pragmatiks-sdk>=25.2.0",
10
10
  "pyyaml>=6.0.3",
11
11
  "copier>=9.0.0",
12
12
  "rich>=13.9.0",
@@ -56,7 +56,7 @@ exclude = ["**/__pycache__/**"]
56
56
 
57
57
  [tool.commitizen]
58
58
  name = "cz_conventional_commits"
59
- version = "16.3.2"
59
+ version = "16.3.3"
60
60
  version_files = ["pyproject.toml:^version"]
61
61
  tag_format = "v$version"
62
62
  bump_message = "bump: version $current_version → $new_version [skip ci]"
@@ -844,6 +844,27 @@ def compute_watch_end(version: ProviderVersion, watch_started_at: float) -> floa
844
844
  return max(minimum_end, deadline_end)
845
845
 
846
846
 
847
+ class AdmissionWatchError(Exception):
848
+ """Polling a watched version failed; carries the version as the watch last read it.
849
+
850
+ Attributes:
851
+ version: The latest version the watch read successfully, or the
852
+ declared version when no read succeeded.
853
+ error: What failed while polling.
854
+ """
855
+
856
+ def __init__(self, version: ProviderVersion, error: Exception) -> None:
857
+ """Record the version the watch last read and the polling failure.
858
+
859
+ Args:
860
+ version: The latest version the watch read successfully.
861
+ error: What failed while polling.
862
+ """
863
+ super().__init__(f"Watching {version.canonical} {version.version} failed")
864
+ self.version = version
865
+ self.error = error
866
+
867
+
847
868
  def watch_admission(
848
869
  client: PragmaClient,
849
870
  declared_version: DeclaredProviderVersion,
@@ -874,26 +895,29 @@ def watch_admission(
874
895
  still unsettled when the watch bound passed first.
875
896
 
876
897
  Raises:
877
- httpx.HTTPStatusError: If reading the version fails.
878
- httpx.TransportError: If the API cannot be reached.
879
- """ # noqa: DOC502
898
+ AdmissionWatchError: If anything fails while polling, carrying the
899
+ latest version read successfully and the failure.
900
+ """
880
901
  version = declared_version
881
902
 
882
- while version.status not in SETTLED_VERSION_STATUSES:
883
- remaining_seconds = compute_watch_end(version, watch_started_at) - time.monotonic()
903
+ try:
904
+ while version.status not in SETTLED_VERSION_STATUSES:
905
+ remaining_seconds = compute_watch_end(version, watch_started_at) - time.monotonic()
884
906
 
885
- if remaining_seconds <= 0:
886
- break
907
+ if remaining_seconds <= 0:
908
+ break
887
909
 
888
- time.sleep(min(ADMISSION_POLL_INTERVAL_SECONDS, remaining_seconds))
889
- previous_status = version.status
890
- version = client.get_provider_version(version.canonical, version.version)
910
+ time.sleep(min(ADMISSION_POLL_INTERVAL_SECONDS, remaining_seconds))
911
+ previous_status = version.status
912
+ version = client.get_provider_version(version.canonical, version.version)
891
913
 
892
- if is_replaced_publish(version, declared_version):
893
- break
914
+ if is_replaced_publish(version, declared_version):
915
+ break
894
916
 
895
- if version.status != previous_status:
896
- show_status(version.status)
917
+ if version.status != previous_status:
918
+ show_status(version.status)
919
+ except Exception as e:
920
+ raise AdmissionWatchError(version, e) from e
897
921
 
898
922
  return version
899
923
 
@@ -947,8 +971,7 @@ def watch_admission_with_progress(
947
971
  The version as :func:`watch_admission` last read it.
948
972
 
949
973
  Raises:
950
- httpx.HTTPStatusError: If reading the version fails.
951
- httpx.TransportError: If the API cannot be reached.
974
+ AdmissionWatchError: If polling fails (see :func:`watch_admission`).
952
975
  """ # noqa: DOC502
953
976
  starting_label = format_watched_status_label(declared_version, declared_version.status)
954
977
 
@@ -1241,12 +1264,12 @@ def publish(
1241
1264
 
1242
1265
  try:
1243
1266
  last_read_version = watch_admission_with_progress(client, declared_version, watch_started_at)
1244
- except Exception as e:
1245
- reason = format_watch_failure_reason(e)
1267
+ except AdmissionWatchError as e:
1268
+ reason = format_watch_failure_reason(e.error)
1246
1269
  try:
1247
- output_data(build_publish_document(declared_version, declared_version), output)
1270
+ output_data(build_publish_document(e.version, declared_version), output)
1248
1271
  finally:
1249
- report_watch_failure(reason, declared_version, republish_command)
1272
+ report_watch_failure(reason, e.version, republish_command)
1250
1273
 
1251
1274
  output_data(build_publish_document(last_read_version, declared_version), output)
1252
1275
 
@@ -1119,6 +1119,22 @@ def format_installation_state(state: str | None) -> str:
1119
1119
  return f"[{color}]{format_installation_state_label(state)}[/{color}]"
1120
1120
 
1121
1121
 
1122
+ def format_running_installation_operation(installation: ProviderInstallation) -> str:
1123
+ """Format an installation's operation for the installed table, only while it runs.
1124
+
1125
+ Args:
1126
+ installation: The installed provider.
1127
+
1128
+ Returns:
1129
+ The operation and its target from :func:`format_installation_operation`
1130
+ while ``operation_running``, or a dim dash once it settled.
1131
+ """
1132
+ if not installation.operation_running:
1133
+ return "[dim]-[/dim]"
1134
+
1135
+ return format_installation_operation(installation.operation_type, installation.operation_version)
1136
+
1137
+
1122
1138
  def format_installation_operation(operation_type: str | None, operation_version: str | None) -> str:
1123
1139
  """Format an operation and the version it targets, such as ``upgrade v3.0.0`` or ``restart v3.0.0``.
1124
1140
 
@@ -1175,7 +1191,7 @@ def print_installed_table(installations: list[ProviderInstallation]) -> None:
1175
1191
  escape(installation.canonical),
1176
1192
  format_installation_state(installation.lifecycle_state),
1177
1193
  format_target_version(installation.installed_version),
1178
- format_installation_operation(installation.operation_type, installation.operation_version),
1194
+ format_running_installation_operation(installation),
1179
1195
  format_optional_value(installation.failure_message),
1180
1196
  )
1181
1197