Skip to content

Commit 2b383d5

Browse files
committed
Merge branch 'dev' into kzscisoft/filter-object
2 parents 14ff365 + 163c4d0 commit 2b383d5

File tree

8 files changed

+99
-81
lines changed

8 files changed

+99
-81
lines changed

.github/workflows/deploy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
name: python-package-distributions
8080
path: dist/
8181
- name: Sign the dists with Sigstore
82-
uses: sigstore/gh-action-sigstore-python@v2
82+
uses: sigstore/gh-action-sigstore-python@v2.1.1
8383
with:
8484
inputs: >-
8585
./dist/*.tar.gz

.github/workflows/test_client_windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
export SIMVUE_TOKEN=${{ secrets.SIMVUE_TOKEN }}
2828
poetry install --all-extras
2929
poetry run python -m pip install torch
30-
poetry run pytest tests/unit/ tests/refactor/ -m 'not scenario'
30+
poetry run pytest tests/unit/ tests/refactor/ -m 'not scenario' -m 'not unix'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
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.5.2
26+
rev: v0.5.5
2727
hooks:
2828
- id: ruff
2929
args: [ --fix, --exit-non-zero-on-fix, "--ignore=C901" ]

poetry.lock

Lines changed: 72 additions & 72 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ description = "Simulation tracking and monitoring"
55
authors = ["Simvue Development Team <[email protected]>"]
66
license = "Apache v2"
77
readme = "README.md"
8+
homepage = "https://simvue.io"
9+
repository = "https://github.com/simvue-io/python-api"
10+
documentation = "https://docs.simvue.io"
811
classifiers = [
912
"Development Status :: 5 - Production/Stable",
1013
"Intended Audience :: Science/Research",

simvue/executor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ def callback_function(status_code: int, std_out: str, std_err: str) -> None:
196196
if not self._runner.name:
197197
raise RuntimeError("Cannot add process, expected Run instance to have name")
198198

199-
if sys.platform == "win32" and completion_callback:
199+
if sys.platform == "win32" and completion_trigger:
200200
logger.warning(
201-
"Completion callback for 'add_process' may fail on Windows due to "
201+
"Completion trigger for 'add_process' may fail on Windows "
202202
"due to function pickling restrictions"
203203
)
204204

simvue/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ def callback_function(status_code: int, std_out: str, std_err: str) -> None:
720720
"""
721721
if platform.system() == "Windows" and completion_trigger:
722722
raise RuntimeError(
723-
"Use of 'completion_callback' on Windows based operating systems is unsupported "
723+
"Use of 'completion_trigger' on Windows based operating systems is unsupported "
724724
"due to function pickling restrictions for multiprocessing"
725725
)
726726

tests/refactor/test_executor.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ def test_executor_add_process(
1717
request: pytest.FixtureRequest
1818
) -> None:
1919
import logging
20+
trigger = multiprocessing.Event()
21+
22+
def completion_callback(*_, trigger=trigger, **__):
23+
trigger.set()
2024
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
2125
run = simvue.Run()
22-
completion_trigger = multiprocessing.Event()
2326
run.init(
2427
f"test_executor_{'success' if successful else 'fail'}",
2528
tags=["simvue_client_unit_tests", request.node.name.replace("[", "_").replace("]", "_")],
@@ -29,10 +32,10 @@ def test_executor_add_process(
2932
identifier=f"test_add_process_{'success' if successful else 'fail'}",
3033
c=f"exit {0 if successful else 1}",
3134
executable="bash" if sys.platform != "win32" else "powershell",
32-
completion_trigger=completion_trigger
35+
completion_callback=completion_callback
3336
)
3437

35-
while not completion_trigger.is_set():
38+
while not trigger.is_set():
3639
time.sleep(1)
3740

3841
if successful:
@@ -43,6 +46,7 @@ def test_executor_add_process(
4346

4447

4548
@pytest.mark.executor
49+
@pytest.mark.unix
4650
def test_executor_multiprocess(request: pytest.FixtureRequest) -> None:
4751
triggers: dict[int, multiprocessing.synchronize.Event] = {}
4852
callbacks: dict[int, typing.Callable] = {}
@@ -127,6 +131,7 @@ def test_add_process_command_assembly(request: pytest.FixtureRequest) -> None:
127131
def test_completion_callbacks_var_change(request: pytest.FixtureRequest) -> None:
128132
success: dict[str, bool] = {"complete": False}
129133
def completion_callback(*_, success: dict[str, bool]=success, **__):
134+
print("YH BOI")
130135
success["complete"] = True
131136

132137
with simvue.Run() as run:
@@ -142,9 +147,13 @@ def completion_callback(*_, success: dict[str, bool]=success, **__):
142147
completion_callback=completion_callback
143148
)
144149

150+
# Need a slight delay before checking
151+
time.sleep(1)
152+
145153
assert success["complete"]
146154

147155
@pytest.mark.executor
156+
@pytest.mark.unix
148157
def test_completion_trigger_set(request: pytest.FixtureRequest) -> None:
149158
trigger = multiprocessing.Event()
150159

@@ -161,6 +170,9 @@ def test_completion_trigger_set(request: pytest.FixtureRequest) -> None:
161170
completion_trigger=trigger
162171
)
163172

173+
# Need a slight delay before checking
174+
time.sleep(1)
175+
164176
assert trigger.is_set()
165177

166178
@pytest.mark.executor
@@ -183,5 +195,8 @@ def completion_callback(*_, trigger=trigger, **__):
183195
completion_callback=completion_callback
184196
)
185197

198+
# Need a slight delay before checking
199+
time.sleep(1)
200+
186201
assert trigger.is_set()
187202

0 commit comments

Comments
 (0)