runem 0.0.11__py3-none-any.whl → 0.0.13__py3-none-any.whl
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.
- runem/run_command.py +4 -8
- runem/runem.py +34 -7
- {runem-0.0.11.dist-info → runem-0.0.13.dist-info}/METADATA +1 -1
- runem-0.0.13.dist-info/RECORD +14 -0
- runem-0.0.11.dist-info/RECORD +0 -14
- {runem-0.0.11.dist-info → runem-0.0.13.dist-info}/LICENSE +0 -0
- {runem-0.0.11.dist-info → runem-0.0.13.dist-info}/WHEEL +0 -0
- {runem-0.0.11.dist-info → runem-0.0.13.dist-info}/entry_points.txt +0 -0
- {runem-0.0.11.dist-info → runem-0.0.13.dist-info}/top_level.txt +0 -0
runem/run_command.py
CHANGED
@@ -16,19 +16,18 @@ def get_stdout(process: subprocess.CompletedProcess, prefix: str) -> str:
|
|
16
16
|
|
17
17
|
|
18
18
|
def run_command( # noqa: C901 # pylint: disable=too-many-branches
|
19
|
+
cmd: typing.List[str], # 'cmd' is the only thing that can't be optionally kwargs
|
19
20
|
label: str,
|
20
|
-
cmd: typing.List[str],
|
21
21
|
verbose: bool,
|
22
22
|
env_overrides: typing.Optional[dict] = None,
|
23
23
|
ignore_fails: bool = False,
|
24
24
|
valid_exit_ids: typing.Optional[typing.Tuple[int, ...]] = None,
|
25
|
+
**kwargs: typing.Any,
|
25
26
|
) -> str:
|
26
27
|
"""Runs the given command, returning stdout or throwing on any error."""
|
27
28
|
cmd_string: str = " ".join(cmd)
|
28
29
|
if verbose:
|
29
|
-
print("runem:
|
30
|
-
print(f"runem: test: {label}")
|
31
|
-
print(f"{cmd_string}")
|
30
|
+
print(f"runem: running: start: {label}: {cmd_string}")
|
32
31
|
if valid_exit_ids is not None:
|
33
32
|
valid_exit_strs = ",".join([str(exit_code) for exit_code in valid_exit_ids])
|
34
33
|
print(f"allowed return ids are: {valid_exit_strs}")
|
@@ -68,9 +67,6 @@ def run_command( # noqa: C901 # pylint: disable=too-many-branches
|
|
68
67
|
if run_env:
|
69
68
|
run_env_param = run_env
|
70
69
|
|
71
|
-
if verbose:
|
72
|
-
print("runem: test: " + "=" * TERMINAL_WIDTH)
|
73
|
-
|
74
70
|
process: subprocess.CompletedProcess
|
75
71
|
try:
|
76
72
|
process = subprocess.run(
|
@@ -110,5 +106,5 @@ def run_command( # noqa: C901 # pylint: disable=too-many-branches
|
|
110
106
|
cmd_stdout: str = get_stdout(process, prefix=label)
|
111
107
|
if verbose:
|
112
108
|
print(cmd_stdout)
|
113
|
-
|
109
|
+
print(f"runem: running: done: {label}: {cmd_string}")
|
114
110
|
return cmd_stdout
|
runem/runem.py
CHANGED
@@ -630,11 +630,12 @@ def _run_job(
|
|
630
630
|
function(args, options, file_list)
|
631
631
|
else:
|
632
632
|
function(
|
633
|
-
options, # type: ignore
|
634
|
-
file_list, # type: ignore
|
633
|
+
options=options, # type: ignore
|
634
|
+
file_list=file_list, # type: ignore
|
635
635
|
procs=args.procs,
|
636
636
|
root_path=root_path,
|
637
637
|
verbose=args.verbose,
|
638
|
+
**job_config,
|
638
639
|
)
|
639
640
|
end = timer()
|
640
641
|
time_taken: timedelta = timedelta(seconds=end - start)
|
@@ -644,7 +645,7 @@ def _run_job(
|
|
644
645
|
|
645
646
|
|
646
647
|
def _get_test_function(
|
647
|
-
cfg_filepath:
|
648
|
+
cfg_filepath: pathlib.Path,
|
648
649
|
module_name: str,
|
649
650
|
module_file_path: pathlib.Path,
|
650
651
|
function_to_load: str,
|
@@ -664,7 +665,16 @@ def _get_test_function(
|
|
664
665
|
if not module_spec.loader:
|
665
666
|
raise FunctionNotFound("unable to load module")
|
666
667
|
module_spec.loader.exec_module(module)
|
667
|
-
|
668
|
+
try:
|
669
|
+
function: JobFunction = getattr(module, function_to_load)
|
670
|
+
except AttributeError as err:
|
671
|
+
raise FunctionNotFound(
|
672
|
+
(
|
673
|
+
f"ERROR! Check that function '{function_to_load}' "
|
674
|
+
f"exists in '{module_file_path}' as expected in "
|
675
|
+
f"your config at '{str(cfg_filepath)}"
|
676
|
+
)
|
677
|
+
) from err
|
668
678
|
return function
|
669
679
|
|
670
680
|
|
@@ -696,9 +706,19 @@ def get_test_function(job_config: JobConfig, cfg_filepath: pathlib.Path) -> JobF
|
|
696
706
|
Also re-address the job-config.
|
697
707
|
"""
|
698
708
|
function_to_load: str = job_config["addr"]["function"]
|
699
|
-
|
700
|
-
|
701
|
-
|
709
|
+
try:
|
710
|
+
module_file_path: pathlib.Path = _find_job_module(
|
711
|
+
cfg_filepath, job_config["addr"]["file"]
|
712
|
+
)
|
713
|
+
except FunctionNotFound as err:
|
714
|
+
raise FunctionNotFound(
|
715
|
+
(
|
716
|
+
f"Whilst loading job '{job_config['label']}' runem failed to find "
|
717
|
+
f"job.addr.file '{job_config['addr']['file']}' looking for "
|
718
|
+
f"job.addr.function '{function_to_load}'"
|
719
|
+
)
|
720
|
+
) from err
|
721
|
+
|
702
722
|
module_name = module_file_path.stem.replace(" ", "_").replace("-", "_")
|
703
723
|
|
704
724
|
try:
|
@@ -856,10 +876,17 @@ def _parse_job_config(
|
|
856
876
|
Returns the tags generated
|
857
877
|
"""
|
858
878
|
try:
|
879
|
+
job_names_used = job["label"] in in_out_job_names
|
880
|
+
if job_names_used:
|
881
|
+
print("ERROR: duplicate job label!")
|
882
|
+
print(f"\t'{job['label']}' is used twice or more in {str(cfg_filepath)}")
|
883
|
+
sys.exit(1)
|
884
|
+
|
859
885
|
# try and load the function _before_ we schedule it's execution
|
860
886
|
get_test_function(job, cfg_filepath)
|
861
887
|
phase_id: PhaseName = job["when"]["phase"]
|
862
888
|
in_out_jobs_by_phase[phase_id].append(job)
|
889
|
+
|
863
890
|
in_out_job_names.add(job["label"])
|
864
891
|
in_out_phases.add(job["when"]["phase"])
|
865
892
|
for tag in job["when"]["tags"]:
|
@@ -0,0 +1,14 @@
|
|
1
|
+
runem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
+
runem/__main__.py,sha256=dsOiVZegpfK9JOs5n7UmbX5iwwbj7iFkEbLoVeEgAn4,136
|
3
|
+
runem/base.py,sha256=EZfR7FIlwEdU9Vfe47Wk2DOO8GQqpKxxLNKp6YHueZ4,316
|
4
|
+
runem/cli.py,sha256=YFwon1P7uSpAYNuJxe2f0wo0HpI3OYTQ-UBWx6xU1iY,145
|
5
|
+
runem/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
+
runem/run_command.py,sha256=eYArn2gwPOTHID2040NxLoaM7yrvPnaWgWvPreRhrm0,3685
|
7
|
+
runem/runem.py,sha256=AXBSnTse_TBWf0dOEyAVOGOrpbCrr3yy0Dgt6b-b-fQ,35796
|
8
|
+
scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
+
runem-0.0.13.dist-info/LICENSE,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
|
10
|
+
runem-0.0.13.dist-info/METADATA,sha256=JE1cGOxKcT39PiEPm2UtHxB9LG9ROTaXfB1CArcnKgY,15909
|
11
|
+
runem-0.0.13.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
12
|
+
runem-0.0.13.dist-info/entry_points.txt,sha256=nu0g_vBeuPihYtimbtlNusxWovylMppvJ8UxdJlJfvM,46
|
13
|
+
runem-0.0.13.dist-info/top_level.txt,sha256=rd8MZEjuPdjwXuLZlbdZEg8_WGxrY1c8M36uHjNjbNk,14
|
14
|
+
runem-0.0.13.dist-info/RECORD,,
|
runem-0.0.11.dist-info/RECORD
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
runem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
2
|
-
runem/__main__.py,sha256=dsOiVZegpfK9JOs5n7UmbX5iwwbj7iFkEbLoVeEgAn4,136
|
3
|
-
runem/base.py,sha256=EZfR7FIlwEdU9Vfe47Wk2DOO8GQqpKxxLNKp6YHueZ4,316
|
4
|
-
runem/cli.py,sha256=YFwon1P7uSpAYNuJxe2f0wo0HpI3OYTQ-UBWx6xU1iY,145
|
5
|
-
runem/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
runem/run_command.py,sha256=SWFUxCwjkpeFjds9G7spR4Zu_DHDCAGHYPLaH5a5qWs,3671
|
7
|
-
runem/runem.py,sha256=yTmL8fUMh70gLMAYDlFU-KV2lp8kZM9r3Huo8sCeu8E,34852
|
8
|
-
scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
runem-0.0.11.dist-info/LICENSE,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
|
10
|
-
runem-0.0.11.dist-info/METADATA,sha256=r-hsbTKM7Swzuy2_hSCnT86htXew084ZNRmwnkU-7w4,15909
|
11
|
-
runem-0.0.11.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
12
|
-
runem-0.0.11.dist-info/entry_points.txt,sha256=nu0g_vBeuPihYtimbtlNusxWovylMppvJ8UxdJlJfvM,46
|
13
|
-
runem-0.0.11.dist-info/top_level.txt,sha256=rd8MZEjuPdjwXuLZlbdZEg8_WGxrY1c8M36uHjNjbNk,14
|
14
|
-
runem-0.0.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|