bec-ipython-client 4.2.1__tar.gz → 4.3.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 (46) hide show
  1. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/PKG-INFO +1 -1
  2. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/pyproject.toml +1 -1
  3. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_procedures_e2e.py +59 -2
  4. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/.gitignore +0 -0
  5. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/__init__.py +0 -0
  6. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/beamline_mixin.py +0 -0
  7. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/bec_magics.py +0 -0
  8. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/bec_startup.py +0 -0
  9. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/__init__.py +0 -0
  10. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/device_progress.py +0 -0
  11. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/ipython_live_updates.py +0 -0
  12. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/live_table.py +0 -0
  13. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/move_device.py +0 -0
  14. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/callbacks/utils.py +0 -0
  15. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/gui_client.py +0 -0
  16. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/high_level_interfaces/__init__.py +0 -0
  17. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/high_level_interfaces/bec_hli.py +0 -0
  18. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/high_level_interfaces/spec_hli.py +0 -0
  19. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/main.py +0 -0
  20. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/SLS/__init__.py +0 -0
  21. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/SLS/sls_info.py +0 -0
  22. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/XTreme/__init__.py +0 -0
  23. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/XTreme/x-treme.py +0 -0
  24. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/__init__.py +0 -0
  25. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/plugins/flomni/flomni_config.yaml +0 -0
  26. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/prettytable.py +0 -0
  27. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/progressbar.py +0 -0
  28. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/bec_ipython_client/signals.py +0 -0
  29. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/demo.py +0 -0
  30. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/conftest.py +0 -0
  31. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_beamline_mixins.py +0 -0
  32. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_bec_client.py +0 -0
  33. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_device_progress.py +0 -0
  34. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_gui_client.py +0 -0
  35. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_ipython_live_updates.py +0 -0
  36. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_live_table.py +0 -0
  37. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_move_callback.py +0 -0
  38. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_pretty_table.py +0 -0
  39. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/client_tests/test_signals.py +0 -0
  40. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/conftest.py +0 -0
  41. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/_ensure_requirements_container.py +0 -0
  42. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_acl_e2e.py +0 -0
  43. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_actors_e2e.py +0 -0
  44. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_scan_workflows_lib_e2e.py +0 -0
  45. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_scans_e2e.py +0 -0
  46. {bec_ipython_client-4.2.1 → bec_ipython_client-4.3.1}/tests/end-2-end/test_scans_lib_e2e.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: bec_ipython_client
3
- Version: 4.2.1
3
+ Version: 4.3.1
4
4
  Summary: BEC IPython client
5
5
  Project-URL: Bug Tracker, https://github.com/bec-project/bec/issues
6
6
  Project-URL: Homepage, https://github.com/bec-project/bec
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "bec_ipython_client"
7
- version = "4.2.1"
7
+ version = "4.3.1"
8
8
  description = "BEC IPython client"
9
9
  requires-python = ">=3.11"
10
10
  classifiers = [
@@ -1,19 +1,28 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import os
3
4
  import time
4
5
  from dataclasses import dataclass
5
6
  from importlib.metadata import version
6
7
  from typing import TYPE_CHECKING, Callable, Generator
7
8
  from unittest.mock import patch
9
+ from uuid import uuid4
8
10
 
9
11
  import pytest
12
+ from pytest_redis import factories as redis_factories
10
13
 
11
14
  from bec_ipython_client.main import BECIPythonClient
12
15
  from bec_lib import messages
13
16
  from bec_lib.endpoints import MessageEndpoints
14
17
  from bec_lib.logger import bec_logger
15
- from bec_server.procedures.constants import _CONTAINER, _WORKER
16
- from bec_server.procedures.container_utils import get_backend
18
+ from bec_lib.procedures.helper import ProcedureState
19
+ from bec_server.procedures.constants import _CONTAINER, _WORKER, PROCEDURE
20
+ from bec_server.procedures.container_utils import (
21
+ _run_and_capture_error,
22
+ get_backend,
23
+ podman_available,
24
+ )
25
+ from bec_server.procedures.container_worker import ContainerProcedureWorker
17
26
  from bec_server.procedures.manager import ProcedureManager
18
27
  from bec_server.procedures.subprocess_worker import SubProcessWorker
19
28
 
@@ -133,3 +142,51 @@ def test_happy_path_container_procedure_runner(
133
142
  assert logtool.is_present_in_any_message(
134
143
  f"Builtin procedure log_message_args_kwargs called with args: {test_args} and kwargs: {test_kwargs}"
135
144
  )
145
+
146
+
147
+ # A separate Redis prevents the scan server's manager from also consuming this request.
148
+ proc_redis = redis_factories.redis_proc()
149
+
150
+
151
+ @pytest.mark.timeout(120)
152
+ @pytest.mark.parametrize(
153
+ "worker_type", [ContainerProcedureWorker, SubProcessWorker], ids=["podman", "subprocess"]
154
+ )
155
+ def test_procedure_execution(proc_redis, monkeypatch, worker_type):
156
+ """Execute a real procedure with either worker backend against isolated Redis.
157
+
158
+ Podman requires the worker image and a host-networked ``local_bec`` pod. For a remote
159
+ Podman VM, BEC_TEST_CONTAINER_REDIS_HOST can supply a container-reachable host.
160
+ """
161
+ uses_container = worker_type is ContainerProcedureWorker
162
+ if uses_container and not podman_available():
163
+ pytest.skip("Podman is not available")
164
+ host, port = proc_redis.host, proc_redis.port
165
+ queue = f"procedure_test_{uuid4().hex}"
166
+ if uses_container and (container_host := os.environ.get("BEC_TEST_CONTAINER_REDIS_HOST")):
167
+ worker_environment = ContainerProcedureWorker._worker_environment
168
+ monkeypatch.setattr(
169
+ ContainerProcedureWorker,
170
+ "_worker_environment",
171
+ lambda worker: worker_environment(worker)
172
+ | {"redis_server": f"{container_host}:{port}"},
173
+ )
174
+ manager = ProcedureManager(f"{host}:{port}", worker_type)
175
+ try:
176
+ status = manager._helper.request.procedure(
177
+ "_log_msg_args", args_kwargs=(("procedure regression",), {}), queue=queue
178
+ )
179
+ status.wait(timeout_s=90, raise_on_failure=True)
180
+ assert status.done, "Procedure remained scheduled"
181
+ assert status.state == ProcedureState.SUCCESS
182
+ _wait_while(lambda: bool(manager.active_workers()), 20)
183
+ logs = manager._conn.xrange(MessageEndpoints.procedure_logs(queue), "-", "+") or []
184
+ assert any("procedure regression" in entry["data"].data for entry in logs)
185
+ assert any("procedure regression" in line for line in manager._logs)
186
+ finally:
187
+ try:
188
+ manager.shutdown()
189
+ finally:
190
+ if uses_container:
191
+ container_name = f"bec_procedure_{PROCEDURE.BEC_VERSION}_{queue}"
192
+ _run_and_capture_error("podman", "rm", "--force", "--ignore", container_name)