Skip to content

Commit 0fc7499

Browse files
committed
Merge branch 'dev' into kzscisoft/sender-refactor
2 parents 3b075ad + 9504932 commit 0fc7499

File tree

4 files changed

+29
-18
lines changed

4 files changed

+29
-18
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ repos:
2323
args: [--branch, main, --branch, dev]
2424
- id: check-added-large-files
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: v0.14.3
26+
rev: v0.14.6
2727
hooks:
2828
- id: ruff
2929
args: [ --fix, --exit-non-zero-on-fix, "--ignore=C901" ]
@@ -35,7 +35,7 @@ repos:
3535
pass_filenames: false
3636

3737
- repo: https://github.com/PyCQA/bandit.git
38-
rev: 1.8.6
38+
rev: 1.9.2
3939
hooks:
4040
- id: bandit
4141
args: [-lll, --recursive, clumper]

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
- Refactored sender functionality introducing new `Sender` class.
66

7+
## [v2.2.4](https://github.com/simvue-io/client/releases/tag/v2.2.4) - 2025-11-13
8+
9+
- Added fixes for future servers which disallow extra arguments in requests.
10+
711
## [v2.2.3](https://github.com/simvue-io/client/releases/tag/v2.2.3) - 2025-11-10
812

913
- Use `msgpack` for `GridMetrics` in a manner similar to `Metrics`.

CITATION.cff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ keywords:
4242
- alerting
4343
- simulation
4444
license: Apache-2.0
45-
commit: 4edec13b494f4b6b034d42ad90f33f98a2058b40
46-
version: 2.2.3
47-
date-released: '2025-11-10'
45+
commit: a973b3ab1b0b4a53295ffdacff296e958b5ebac3
46+
version: 2.2.4
47+
date-released: '2025-11-13'

tests/conftest.py

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from collections.abc import Generator
12
import contextlib
23
from _pytest import monkeypatch
34
import numpy
@@ -138,9 +139,11 @@ def prevent_script_exit(monkeypatch: monkeypatch.MonkeyPatch) -> None:
138139

139140

140141
@pytest.fixture
141-
def create_test_run(request, prevent_script_exit) -> typing.Generator[typing.Tuple[sv_run.Run, dict], None, None]:
142+
def create_test_run(request, prevent_script_exit) -> Generator[tuple[sv_run.Run, dict]]:
143+
_ = prevent_script_exit
142144
with sv_run.Run() as run:
143-
_test_run_data = setup_test_run(run, True, request)
145+
with tempfile.TemporaryDirectory() as tempd:
146+
_test_run_data = setup_test_run(run, temp_dir=pathlib.Path(tempd), create_objects=True, request=request)
144147
yield run, _test_run_data
145148
with contextlib.suppress(ObjectNotFoundError):
146149
sv_api_obj.Folder(identifier=run._folder.id).delete(recursive=True, delete_runs=True, runs_only=False)
@@ -151,13 +154,12 @@ def create_test_run(request, prevent_script_exit) -> typing.Generator[typing.Tup
151154

152155

153156
@pytest.fixture
154-
def create_test_run_offline(request, monkeypatch: pytest.MonkeyPatch, prevent_script_exit) -> typing.Generator[typing.Tuple[sv_run.Run, dict], None, None]:
155-
def testing_exit(status: int) -> None:
156-
raise SystemExit(status)
157+
def create_test_run_offline(request, monkeypatch: pytest.MonkeyPatch, prevent_script_exit) -> Generator[tuple[sv_run.Run, dict]]:
158+
_ = prevent_script_exit
157159
with tempfile.TemporaryDirectory() as temp_d:
158160
monkeypatch.setenv("SIMVUE_OFFLINE_DIRECTORY", temp_d)
159161
with sv_run.Run("offline") as run:
160-
_test_run_data = setup_test_run(run, temp_d, True, request)
162+
_test_run_data = setup_test_run(run, temp_dir=pathlib.Path(temp_d), create_objects=True, request=request)
161163
yield run, _test_run_data
162164
with contextlib.suppress(ObjectNotFoundError):
163165
sv_api_obj.Folder(identifier=run._folder.id).delete(recursive=True, delete_runs=True, runs_only=False)
@@ -168,29 +170,34 @@ def testing_exit(status: int) -> None:
168170

169171

170172
@pytest.fixture
171-
def create_plain_run(request, prevent_script_exit, mocker) -> typing.Generator[typing.Tuple[sv_run.Run, dict], None, None]:
173+
def create_plain_run(request, prevent_script_exit, mocker) -> Generator[tuple[sv_run.Run, dict]]:
174+
_ = prevent_script_exit
172175
def testing_exit(status: int) -> None:
173176
raise SystemExit(status)
174177
with sv_run.Run() as run:
175178
run.metric_spy = mocker.spy(run, "_get_internal_metrics")
176-
yield run, setup_test_run(run, False, request)
179+
with tempfile.TemporaryDirectory() as tempd:
180+
yield run, setup_test_run(run, temp_dir=pathlib.Path(tempd), create_objects=False, request=request)
177181
clear_out_files()
178182

179183

180184
@pytest.fixture
181-
def create_pending_run(request, prevent_script_exit) -> typing.Generator[typing.Tuple[sv_run.Run, dict], None, None]:
185+
def create_pending_run(request, prevent_script_exit) -> Generator[tuple[sv_run.Run, dict]]:
186+
_ = prevent_script_exit
182187
with sv_run.Run() as run:
183-
yield run, setup_test_run(run, False, request, True)
188+
with tempfile.TemporaryDirectory() as tempd:
189+
yield run, setup_test_run(run, temp_dir=pathlib.Path(tempd), create_objects=False, request=request, created_only=True)
184190
clear_out_files()
185191

186192

187193
@pytest.fixture
188-
def create_plain_run_offline(request,prevent_script_exit,monkeypatch) -> typing.Generator[typing.Tuple[sv_run.Run, dict], None, None]:
194+
def create_plain_run_offline(request,prevent_script_exit,monkeypatch) -> Generator[tuple[sv_run.Run, dict]]:
195+
_ = prevent_script_exit
189196
with tempfile.TemporaryDirectory() as temp_d:
190197
monkeypatch.setenv("SIMVUE_OFFLINE_DIRECTORY", temp_d)
191198
with sv_run.Run("offline") as run:
192199
_temporary_directory = pathlib.Path(temp_d)
193-
yield run, setup_test_run(run, _temporary_directory,False, request)
200+
yield run, setup_test_run(run, temp_dir=_temporary_directory, create_objects=False, request=request)
194201
clear_out_files()
195202

196203

@@ -207,7 +214,7 @@ def testing_exit(status: int) -> None:
207214
_folder.delete(recursive=True, runs_only=False, delete_runs=True)
208215

209216

210-
def setup_test_run(run: sv_run.Run, temp_dir: pathlib.Path, create_objects: bool, request: pytest.FixtureRequest, created_only: bool=False):
217+
def setup_test_run(run: sv_run.Run, *, temp_dir: pathlib.Path, create_objects: bool, request: pytest.FixtureRequest, created_only: bool=False):
211218
fix_use_id: str = str(uuid.uuid4()).split('-', 1)[0]
212219
_test_name: str = request.node.name.replace("[", "_").replace("]", "")
213220
TEST_DATA = {

0 commit comments

Comments
 (0)