edge-containers-cli 3.5.2__tar.gz → 3.5.4__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 (107) hide show
  1. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/workflows/ci.yml +2 -2
  2. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/PKG-INFO +3 -3
  3. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/pyproject.toml +6 -5
  4. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/_version.py +2 -2
  5. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/k8s_commands.py +7 -5
  6. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/local_commands.py +18 -1
  7. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/monitor.py +43 -18
  8. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/docker.py +2 -2
  9. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/shell.py +2 -3
  10. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli.egg-info/PKG-INFO +3 -3
  11. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/conftest.py +2 -2
  12. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/local.yaml +2 -2
  13. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.copier-answers.yml +0 -0
  14. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.devcontainer/devcontainer.json +0 -0
  15. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/CONTRIBUTING.md +0 -0
  16. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/actions/install_requirements/action.yml +0 -0
  17. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/dependabot.yml +0 -0
  18. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/pages/index.html +0 -0
  19. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/pages/make_switcher.py +0 -0
  20. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/workflows/_check.yml +0 -0
  21. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/workflows/_dist.yml +0 -0
  22. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/workflows/_pypi.yml +0 -0
  23. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/workflows/_release.yml +0 -0
  24. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/workflows/_sys_test.yml +0 -0
  25. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/workflows/_test.yml +0 -0
  26. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.github/workflows/_tox.yml +0 -0
  27. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.gitignore +0 -0
  28. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.pre-commit-config.yaml +0 -0
  29. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.vscode/extensions.json +0 -0
  30. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.vscode/launch.json +0 -0
  31. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.vscode/settings.json +0 -0
  32. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/.vscode/tasks.json +0 -0
  33. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/Dockerfile +0 -0
  34. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/LICENSE +0 -0
  35. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/README.md +0 -0
  36. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/catalog-info.yaml +0 -0
  37. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/conf.py +0 -0
  38. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/explanations/decisions/0001-record-architecture-decisions.rst +0 -0
  39. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/explanations/decisions/0002-switched-to-pip-skeleton.rst +0 -0
  40. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/explanations/decisions.rst +0 -0
  41. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/build-docs.rst +0 -0
  42. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/contribute.rst +0 -0
  43. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/lint.rst +0 -0
  44. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/make-release.rst +0 -0
  45. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/pin-requirements.rst +0 -0
  46. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/run-tests.rst +0 -0
  47. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/static-analysis.rst +0 -0
  48. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/test-container.rst +0 -0
  49. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/how-to/update-tools.rst +0 -0
  50. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/index.rst +0 -0
  51. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/reference/standards.rst +0 -0
  52. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/developer/tutorials/dev-install.rst +0 -0
  53. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/genindex.rst +0 -0
  54. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/images/dls-favicon.ico +0 -0
  55. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/images/dls-logo.svg +0 -0
  56. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/index.rst +0 -0
  57. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/user/explanations/docs-structure.rst +0 -0
  58. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/user/how-to/run-container.rst +0 -0
  59. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/user/index.rst +0 -0
  60. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/user/reference/api.rst +0 -0
  61. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/docs/user/tutorials/installation.rst +0 -0
  62. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/setup.cfg +0 -0
  63. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/__init__.py +0 -0
  64. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/__main__.py +0 -0
  65. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/autocomplete.py +0 -0
  66. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/__init__.py +0 -0
  67. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/cli.py +0 -0
  68. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/commands.py +0 -0
  69. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/helm.py +0 -0
  70. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/kubectl.py +0 -0
  71. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/cmds/monitor.tcss +0 -0
  72. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/git.py +0 -0
  73. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/globals.py +0 -0
  74. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/logging.py +0 -0
  75. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli/utils.py +0 -0
  76. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli.egg-info/SOURCES.txt +0 -0
  77. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli.egg-info/dependency_links.txt +0 -0
  78. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli.egg-info/entry_points.txt +0 -0
  79. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli.egg-info/requires.txt +0 -0
  80. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/src/edge_containers_cli.egg-info/top_level.txt +0 -0
  81. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/__init__.py +0 -0
  82. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/autocomplete.yaml +0 -0
  83. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/.copier-answers.yml +0 -0
  84. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/.github/dependabot.yml +0 -0
  85. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/.github/workflows/ci_verify.sh +0 -0
  86. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/.github/workflows/verify.yml +0 -0
  87. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/.gitignore +0 -0
  88. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/LICENSE +0 -0
  89. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/README.md +0 -0
  90. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/environment.sh +0 -0
  91. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/helm/shared/Chart.yaml +0 -0
  92. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/helm/shared/README.md +0 -0
  93. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/helm/shared/values.yaml +0 -0
  94. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/include/iocs/Chart.yaml +0 -0
  95. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/include/iocs/templates/configmap.yaml +0 -0
  96. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/services/bl01t-ea-test-01/Chart.yaml +0 -0
  97. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/services/bl01t-ea-test-01/config/ioc.db +0 -0
  98. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/services/bl01t-ea-test-01/config/ioc.yaml +0 -0
  99. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/services/bl01t-ea-test-01/pretend_helm.tgz +0 -0
  100. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/services/bl01t-ea-test-01/values.yaml +0 -0
  101. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/bl01t/update-helm +0 -0
  102. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/data/ioc.yaml +0 -0
  103. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/test_autocomplete.py +0 -0
  104. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/test_cli.py +0 -0
  105. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/test_ioc.py +0 -0
  106. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/test_local.py +0 -0
  107. {edge_containers_cli-3.5.2 → edge_containers_cli-3.5.4}/tests/test_system.py +0 -0
@@ -21,7 +21,7 @@ jobs:
21
21
  strategy:
22
22
  matrix:
23
23
  runs-on: ["ubuntu-latest"] # can add windows-latest, macos-latest
24
- python-version: ["3.9", "3.10", "3.11"]
24
+ python-version: ["3.10", "3.11", "3.12"]
25
25
  include:
26
26
  # Include one that runs in the dev environment
27
27
  - runs-on: "ubuntu-latest"
@@ -40,7 +40,7 @@ jobs:
40
40
  strategy:
41
41
  matrix:
42
42
  runs-on: ["ubuntu-latest"]
43
- python-version: ["3.11"]
43
+ python-version: ["3.12"]
44
44
  fail-fast: false
45
45
  uses: ./.github/workflows/_sys_test.yml
46
46
  with:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: edge-containers-cli
3
- Version: 3.5.2
3
+ Version: 3.5.4
4
4
  Summary: CLI for deploying and managing epics containers IOCs and services
5
5
  Author-email: Giles Knap <giles.knap@gmail.com>
6
6
  License: Apache License
@@ -208,10 +208,10 @@ License: Apache License
208
208
  Project-URL: GitHub, https://github.com/epics-containers/edge-containers-cli
209
209
  Classifier: Development Status :: 3 - Alpha
210
210
  Classifier: License :: OSI Approved :: Apache Software License
211
- Classifier: Programming Language :: Python :: 3.9
212
211
  Classifier: Programming Language :: Python :: 3.10
213
212
  Classifier: Programming Language :: Python :: 3.11
214
- Requires-Python: >=3.9
213
+ Classifier: Programming Language :: Python :: 3.12
214
+ Requires-Python: >=3.10
215
215
  Description-Content-Type: text/markdown
216
216
  License-File: LICENSE
217
217
  Requires-Dist: natsort
@@ -7,9 +7,9 @@ name = "edge-containers-cli"
7
7
  classifiers = [
8
8
  "Development Status :: 3 - Alpha",
9
9
  "License :: OSI Approved :: Apache Software License",
10
- "Programming Language :: Python :: 3.9",
11
10
  "Programming Language :: Python :: 3.10",
12
11
  "Programming Language :: Python :: 3.11",
12
+ "Programming Language :: Python :: 3.12",
13
13
  ]
14
14
  description = "CLI for deploying and managing epics containers IOCs and services"
15
15
 
@@ -26,7 +26,7 @@ dependencies = [
26
26
  dynamic = ["version"]
27
27
  license.file = "LICENSE"
28
28
  readme = "README.md"
29
- requires-python = ">=3.9"
29
+ requires-python = ">=3.10"
30
30
 
31
31
  [project.optional-dependencies]
32
32
  dev = [
@@ -109,9 +109,10 @@ commands =
109
109
  src = ["src", "tests"]
110
110
  line-length = 88
111
111
  lint.ignore = [
112
- "C408", # Unnecessary collection call - e.g. list(...) instead of [...]
113
- "E501", # Line too long, should be fixed by black.
114
- "B008", # Do not perform function calls in argument defaults.
112
+ "C408", # Unnecessary collection call - e.g. list(...) instead of [...]
113
+ "E501", # Line too long, should be fixed by black.
114
+ "B008", # Do not perform function calls in argument defaults.
115
+ "UP007", # Do not complain about Optional[] (TODO: remove once typer is patched)
115
116
  ]
116
117
  lint.select = [
117
118
  "B", # flake8-bugbear - https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '3.5.2'
16
- __version_tuple__ = version_tuple = (3, 5, 2)
15
+ __version__ = version = '3.5.4'
16
+ __version_tuple__ = version_tuple = (3, 5, 4)
@@ -7,7 +7,7 @@ Relies on the Helm class for deployment aspects.
7
7
  from datetime import datetime
8
8
  from io import StringIO
9
9
  from pathlib import Path
10
- from typing import Optional, Union
10
+ from typing import Optional
11
11
 
12
12
  import polars
13
13
  import typer
@@ -39,7 +39,7 @@ def check_service(service_name: str, namespace: str) -> str:
39
39
  return str(result).strip()
40
40
 
41
41
 
42
- def check_namespace(namespace: Optional[str]):
42
+ def check_namespace(namespace: str | None):
43
43
  """
44
44
  Verify we have a good namespace that exists in the cluster
45
45
  """
@@ -125,7 +125,7 @@ class K8sCommands(Commands):
125
125
 
126
126
  def logs(
127
127
  self, service_name: str, prev: bool, follow: bool, stdout: bool = False
128
- ) -> Optional[Union[str, bool]]:
128
+ ) -> Optional[str | bool]:
129
129
  fullname = check_service(service_name, self.namespace)
130
130
  previous = "-p" if prev else ""
131
131
  fol = "-f" if follow else ""
@@ -194,7 +194,9 @@ class K8sCommands(Commands):
194
194
  has_header=False,
195
195
  new_columns=["name", "running", "restarts"],
196
196
  )
197
- services_df = services_df.join(gtpo_df, on="name", how="left")
197
+ services_df = services_df.join(
198
+ gtpo_df, on="name", how="left", coalesce=True
199
+ )
198
200
  services_df = services_df.with_columns(
199
201
  polars.col("running").replace({"Running": True}, default=False),
200
202
  polars.col("restarts").fill_null(0),
@@ -214,7 +216,7 @@ class K8sCommands(Commands):
214
216
  helm_df = polars.read_json(StringIO(str(helm_out)))
215
217
  helm_df = helm_df.rename({"app_version": "version", "updated": "deployed"})
216
218
  helm_df = helm_df.with_columns(polars.col("deployed").str.slice(0, 19))
217
- services_df = services_df.join(helm_df, on="name", how="left")
219
+ services_df = services_df.join(helm_df, on="name", how="left", coalesce=True)
218
220
  log.debug(services_df)
219
221
 
220
222
  # Arrange columns
@@ -10,6 +10,7 @@ tool like Portainer is a decent workflow.
10
10
  """
11
11
 
12
12
  import json
13
+ import os
13
14
  import re
14
15
  import tempfile
15
16
  from datetime import datetime
@@ -84,9 +85,25 @@ class LocalCommands(Commands):
84
85
 
85
86
  vol = f"-v {volume}:{globals.IOC_CONFIG_FOLDER}"
86
87
  label = f"-l is_IOC=true -l version={version}"
87
- cmd = f"run -dit --net host --restart unless-stopped {label} {vol} {args}"
88
88
  dest = "busybox:copyto"
89
89
 
90
+ # use environment to configure volumes and user id
91
+ data_folder = os.getenv("EC_LOCAL_DATA_FOLDER")
92
+ if data_folder:
93
+ vol = vol + f" -v {data_folder}:{data_folder}"
94
+ opi_folder = os.getenv("EC_LOCAL_OPI_FOLDER")
95
+ if opi_folder:
96
+ vol = vol + f" -v {opi_folder}:/epics/opi"
97
+
98
+ user_id = os.getenv("EC_LOCAL_USER_ID")
99
+ ids = f"-u {user_id}" if user_id else ""
100
+ group_id = os.getenv("EC_LOCAL_GROUP_ID")
101
+ if group_id:
102
+ cmd = f"{ids} -g {group_id}"
103
+
104
+ cmd = f"run -dit --net host --restart unless-stopped {label} {vol} {args} {ids}"
105
+ cmd = cmd.strip()
106
+
90
107
  # get the config into the volume before launching the IOC container
91
108
  shell.run_command(f"{self.docker.docker} rm -f busybox", interactive=False)
92
109
  shell.run_command(
@@ -1,9 +1,10 @@
1
1
  """TUI monitor for containerised IOCs."""
2
2
 
3
+ from collections.abc import Callable
3
4
  from functools import total_ordering
4
5
  from threading import Thread
5
6
  from time import sleep
6
- from typing import Any, Callable, Union, cast
7
+ from typing import Any, cast
7
8
 
8
9
  import polars
9
10
  from rich.style import Style
@@ -185,17 +186,41 @@ class SortableText(Text):
185
186
  def __lt__(self, other: Any) -> bool:
186
187
  if type(other) != SortableText:
187
188
  return NotImplemented
188
- return cast(bool, self.value < other.value)
189
+
190
+ # Handle None as values
191
+ match self.value, other.value:
192
+ case (None, None) | (None, _):
193
+ return False
194
+ case (_, None):
195
+ return True
196
+ case _:
197
+ return cast(bool, self.value < other.value)
189
198
 
190
199
  def __gt__(self, other: Any) -> bool:
191
200
  if type(other) != SortableText:
192
201
  return NotImplemented
193
- return cast(bool, self.value > other.value)
202
+
203
+ # Handle None as values
204
+ match self.value, other.value:
205
+ case (None, None) | (_, None):
206
+ return False
207
+ case (None, _):
208
+ return True
209
+ case _:
210
+ return cast(bool, self.value > other.value)
194
211
 
195
212
  def __eq__(self, other: Any) -> bool:
196
213
  if type(other) != SortableText:
197
214
  return NotImplemented
198
- return cast(bool, self.value == other.value)
215
+
216
+ # Handle None as values
217
+ match self.value, other.value:
218
+ case (None, _) | (_, None):
219
+ return False
220
+ case (None, None):
221
+ return True
222
+ case _:
223
+ return cast(bool, self.value == other.value)
199
224
 
200
225
 
201
226
  class IocTable(Widget):
@@ -240,7 +265,7 @@ class IocTable(Widget):
240
265
  self.iocs[i] = ioc
241
266
  self.columns = [key for key in self.iocs[0].keys() if key not in exclude]
242
267
 
243
- def _convert_df_to_list(self, iocs_df: Union[polars.DataFrame, list]) -> list[dict]:
268
+ def _convert_df_to_list(self, iocs_df: polars.DataFrame | list) -> list[dict]:
244
269
  if isinstance(iocs_df, polars.DataFrame):
245
270
  iocs = iocs_df.to_dicts()
246
271
  else:
@@ -353,18 +378,6 @@ class IocTable(Widget):
353
378
 
354
379
 
355
380
  class MonitorApp(App):
356
- def __init__(
357
- self,
358
- beamline: str,
359
- commands: Commands,
360
- running_only: bool,
361
- ) -> None:
362
- super().__init__()
363
-
364
- self.commands = commands
365
- self.running_only = running_only
366
- self.beamline = beamline
367
-
368
381
  CSS_PATH = "monitor.tcss"
369
382
 
370
383
  BINDINGS = [
@@ -377,6 +390,18 @@ class MonitorApp(App):
377
390
  # Binding("d", "toggle_dark", "Toggle dark mode"),
378
391
  ]
379
392
 
393
+ def __init__(
394
+ self,
395
+ beamline: str,
396
+ commands: Commands,
397
+ running_only: bool,
398
+ ) -> None:
399
+ super().__init__()
400
+
401
+ self.commands = commands
402
+ self.running_only = running_only
403
+ self.beamline = beamline
404
+
380
405
  def compose(self) -> ComposeResult:
381
406
  """Create child widgets for the app."""
382
407
  yield Header(show_clock=True)
@@ -409,7 +434,7 @@ class MonitorApp(App):
409
434
  col_keys = [ord_col.key.value for ord_col in table.ordered_columns]
410
435
  col_i = col_keys.index(col_key)
411
436
  ioc_col = table.ordered_columns[col_i]
412
- cell: Union[str, SortableText] = table.get_cell(ioc_row.key, ioc_col.key)
437
+ cell: str | SortableText = table.get_cell(ioc_row.key, ioc_col.key)
413
438
  # SortableText inherits __str__() from Text
414
439
  return str(cell)
415
440
 
@@ -5,7 +5,7 @@ Utility functions for working interacting with docker / podman CLI
5
5
  import re
6
6
  from pathlib import Path
7
7
  from time import sleep
8
- from typing import Optional, Union
8
+ from typing import Optional
9
9
 
10
10
  import typer
11
11
 
@@ -111,7 +111,7 @@ class Docker:
111
111
  previous: bool = False,
112
112
  follow: bool = False,
113
113
  stdout: bool = False,
114
- ) -> Optional[Union[str, bool]]:
114
+ ) -> Optional[str | bool]:
115
115
  """
116
116
  show logs from a container
117
117
  """
@@ -3,7 +3,6 @@ functions for executing commands and querying environment in the linux shell
3
3
  """
4
4
 
5
5
  import subprocess
6
- from typing import Union
7
6
 
8
7
  import typer
9
8
  from rich.console import Console
@@ -39,7 +38,7 @@ def echo_output(output: str):
39
38
 
40
39
  def run_command(
41
40
  command: str, interactive=True, error_OK=False, show=False
42
- ) -> Union[str, bool]:
41
+ ) -> str | bool:
43
42
  """
44
43
  Run a command and return the output
45
44
 
@@ -65,7 +64,7 @@ def run_command(
65
64
  error_out = p_result.stderr.decode()
66
65
 
67
66
  if interactive:
68
- result: Union[str, bool] = p_result.returncode == 0
67
+ result: str | bool = p_result.returncode == 0
69
68
  else:
70
69
  result = output + error_out
71
70
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: edge-containers-cli
3
- Version: 3.5.2
3
+ Version: 3.5.4
4
4
  Summary: CLI for deploying and managing epics containers IOCs and services
5
5
  Author-email: Giles Knap <giles.knap@gmail.com>
6
6
  License: Apache License
@@ -208,10 +208,10 @@ License: Apache License
208
208
  Project-URL: GitHub, https://github.com/epics-containers/edge-containers-cli
209
209
  Classifier: Development Status :: 3 - Alpha
210
210
  Classifier: License :: OSI Approved :: Apache Software License
211
- Classifier: Programming Language :: Python :: 3.9
212
211
  Classifier: Programming Language :: Python :: 3.10
213
212
  Classifier: Programming Language :: Python :: 3.11
214
- Requires-Python: >=3.9
213
+ Classifier: Programming Language :: Python :: 3.12
214
+ Requires-Python: >=3.10
215
215
  Description-Content-Type: text/markdown
216
216
  License-File: LICENSE
217
217
  Requires-Dist: natsort
@@ -1,8 +1,8 @@
1
1
  import re
2
2
  import shutil
3
+ from collections.abc import Callable
3
4
  from pathlib import Path
4
5
  from types import SimpleNamespace
5
- from typing import Callable, Union
6
6
 
7
7
  from pytest import fixture
8
8
  from ruamel.yaml import YAML
@@ -73,7 +73,7 @@ class MockRun:
73
73
 
74
74
  return rsp
75
75
 
76
- def set_seq(self, cmd_rsp: list[dict[str, Union[str, bool]]]):
76
+ def set_seq(self, cmd_rsp: list[dict[str, str | bool]]):
77
77
  """
78
78
  Set up the expected sequence of commands that we expect to see come
79
79
  through the mock of run_command. Also supplies the response to
@@ -37,7 +37,7 @@ deploy_local:
37
37
  rsp: ""
38
38
  - cmd: docker rm -f busybox
39
39
  rsp: ""
40
- - cmd: docker run -dit --net host --restart unless-stopped -l is_IOC=true -l version=.* -v bl01t-ea-test-01_config:\/epics\/ioc\/config\/ --name bl01t-ea-test-01 ghcr.io\/epics-containers\/ioc-adsimdetector-runtime:2024.4.1
40
+ - cmd: docker run -dit --net host --restart unless-stopped -l is_IOC=true -l version=.* -v bl01t-ea-test-01_config:\/epics\/ioc\/config\/ --name bl01t-ea-test-01 ghcr.io\/epics-containers\/ioc-adsimdetector-runtime:2024.4.1
41
41
  rsp: True
42
42
  - cmd: docker ps -f name=bl01t-ea-test-01 --format .*
43
43
  rsp: bl01t-ea-test-01
@@ -64,7 +64,7 @@ deploy:
64
64
  rsp: ""
65
65
  - cmd: docker rm -f busybox
66
66
  rsp: ""
67
- - cmd: docker run -dit --net host --restart unless-stopped -l is_IOC=true -l version=2.0 -v bl01t-ea-test-01_config:/epics/ioc/config/ --name bl01t-ea-test-01 ghcr.io/epics-containers/ioc-adsimdetector-runtime:2024.4.1
67
+ - cmd: docker run -dit --net host --restart unless-stopped -l is_IOC=true -l version=2.0 -v bl01t-ea-test-01_config:/epics/ioc/config/ --name bl01t-ea-test-01 ghcr.io/epics-containers/ioc-adsimdetector-runtime:2024.4.1
68
68
  rsp: True
69
69
  - cmd: docker ps -f name=bl01t-ea-test-01 --format .*
70
70
  rsp: bl01t-ea-test-01