Skip to content

Commit

Permalink
Move runners to external package
Browse files Browse the repository at this point in the history
  • Loading branch information
nx10 committed May 23, 2024
1 parent c0186e7 commit e0f68dd
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 139 deletions.
1 change: 0 additions & 1 deletion src/styx/runners/__init__.py

This file was deleted.

112 changes: 0 additions & 112 deletions src/styx/runners/docker.py

This file was deleted.

20 changes: 10 additions & 10 deletions tests/test_carg_building.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import styx.compiler.core
import styx.compiler.settings
import styx.runners.dummy
import tests.utils.dummy_runner
from tests.utils.dynmodule import (
BT_TYPE_FILE,
BT_TYPE_FLAG,
Expand Down Expand Up @@ -30,7 +30,7 @@ def test_positional_string_arg() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner, x="my_string")

assert dummy_runner.last_cargs is not None
Expand All @@ -54,7 +54,7 @@ def test_positional_number_arg() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner, x="123")

assert dummy_runner.last_cargs is not None
Expand All @@ -78,7 +78,7 @@ def test_positional_file_arg() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner, x="/my/file.txt")

assert dummy_runner.last_cargs is not None
Expand All @@ -103,7 +103,7 @@ def test_flag_arg() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner, x="my_string")

assert dummy_runner.last_cargs is not None
Expand All @@ -128,7 +128,7 @@ def test_named_arg() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner, x="my_string")

assert dummy_runner.last_cargs is not None
Expand Down Expand Up @@ -162,7 +162,7 @@ def test_list_of_strings_arg() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner, x=["my_string1", "my_string2"], y=["my_string3", "my_string4"])

assert dummy_runner.last_cargs is not None
Expand Down Expand Up @@ -196,7 +196,7 @@ def test_list_of_numbers_arg() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner, x=[1, 2], y=[3, 4])

assert dummy_runner.last_cargs is not None
Expand All @@ -221,7 +221,7 @@ def test_static_args() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner, x="my_string")

assert dummy_runner.last_cargs is not None
Expand Down Expand Up @@ -266,7 +266,7 @@ def test_arg_order() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy("aaa", "bbb", runner=dummy_runner)

assert dummy_runner.last_cargs is not None
Expand Down
4 changes: 2 additions & 2 deletions tests/test_default_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import styx.compiler.core
import styx.compiler.settings
import styx.runners.dummy
import tests.utils.dummy_runner
from tests.utils.dynmodule import (
BT_TYPE_STRING,
boutiques_dummy,
Expand All @@ -28,7 +28,7 @@ def test_default_string_arg() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
test_module.dummy(runner=dummy_runner)

assert dummy_runner.last_cargs is not None
Expand Down
8 changes: 4 additions & 4 deletions tests/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import styx.compiler.core
import styx.compiler.settings
import styx.runners.dummy
import tests.utils.dummy_runner
from tests.utils.dynmodule import (
BT_TYPE_NUMBER,
boutiques_dummy,
Expand Down Expand Up @@ -57,7 +57,7 @@ def test_mutually_exclusive() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()

with pytest.raises(ValueError):
test_module.dummy(runner=dummy_runner, x=1, y=2)
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_all_or_none() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
with pytest.raises(ValueError):
test_module.dummy(runner=dummy_runner, x=1, y=2)
with pytest.raises(ValueError):
Expand Down Expand Up @@ -118,7 +118,7 @@ def test_one_required() -> None:
print(compiled_module)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
with pytest.raises(ValueError):
test_module.dummy(runner=dummy_runner)

Expand Down
12 changes: 6 additions & 6 deletions tests/test_numeric_ranges.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import styx.compiler.core
import styx.compiler.settings
import styx.runners.dummy
import tests.utils.dummy_runner
from tests.utils.dynmodule import (
BT_TYPE_NUMBER,
boutiques_dummy,
Expand All @@ -31,7 +31,7 @@ def test_below_range_minimum_inclusive() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
with pytest.raises(ValueError):
test_module.dummy(runner=dummy_runner, x=4)

Expand All @@ -55,7 +55,7 @@ def test_above_range_maximum_inclusive() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
with pytest.raises(ValueError):
test_module.dummy(runner=dummy_runner, x=6)

Expand All @@ -80,7 +80,7 @@ def test_above_range_maximum_exclusive() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
with pytest.raises(ValueError):
test_module.dummy(runner=dummy_runner, x=5)

Expand All @@ -105,7 +105,7 @@ def test_below_range_minimum_exclusive() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
with pytest.raises(ValueError):
test_module.dummy(runner=dummy_runner, x=5)

Expand All @@ -130,7 +130,7 @@ def test_outside_range() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
with pytest.raises(ValueError):
test_module.dummy(runner=dummy_runner, x=11)

Expand Down
8 changes: 4 additions & 4 deletions tests/test_output_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import styx.compiler.core
import styx.compiler.settings
import styx.runners.dummy
import tests.utils.dummy_runner
from tests.utils.dynmodule import (
BT_TYPE_FILE,
BT_TYPE_NUMBER,
Expand Down Expand Up @@ -35,7 +35,7 @@ def test_output_file() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
out = test_module.dummy(runner=dummy_runner, x=5)

assert dummy_runner.last_cargs is not None
Expand Down Expand Up @@ -68,7 +68,7 @@ def test_output_file_with_template() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
out = test_module.dummy(runner=dummy_runner, x=5)

assert dummy_runner.last_cargs is not None
Expand Down Expand Up @@ -102,7 +102,7 @@ def test_output_file_with_template_and_stripped_extensions() -> None:
compiled_module = styx.compiler.core.compile_boutiques_dict(model)

test_module = dynamic_module(compiled_module, "test_module")
dummy_runner = styx.runners.dummy.DummyRunner()
dummy_runner = tests.utils.dummy_runner.DummyRunner()
out = test_module.dummy(runner=dummy_runner, x="in.txt")

assert dummy_runner.last_cargs is not None
Expand Down
1 change: 1 addition & 0 deletions tests/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Test utilities."""
File renamed without changes.

0 comments on commit e0f68dd

Please sign in to comment.