runem 0.2.0__py3-none-any.whl → 0.3.0__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/VERSION +1 -1
- runem/job.py +16 -0
- runem/job_runner_simple_command.py +19 -1
- {runem-0.2.0.dist-info → runem-0.3.0.dist-info}/METADATA +1 -1
- {runem-0.2.0.dist-info → runem-0.3.0.dist-info}/RECORD +9 -9
- {runem-0.2.0.dist-info → runem-0.3.0.dist-info}/LICENSE +0 -0
- {runem-0.2.0.dist-info → runem-0.3.0.dist-info}/WHEEL +0 -0
- {runem-0.2.0.dist-info → runem-0.3.0.dist-info}/entry_points.txt +0 -0
- {runem-0.2.0.dist-info → runem-0.3.0.dist-info}/top_level.txt +0 -0
runem/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
runem/job.py
CHANGED
@@ -11,6 +11,12 @@ class NoJobName(ValueError):
|
|
11
11
|
pass
|
12
12
|
|
13
13
|
|
14
|
+
class BadWhenConfigLocation(ValueError):
|
15
|
+
"""The job-config does not contain a label and can't be coerced to crate one."""
|
16
|
+
|
17
|
+
pass
|
18
|
+
|
19
|
+
|
14
20
|
class Job:
|
15
21
|
"""A class with utility functions for jobs.
|
16
22
|
|
@@ -27,6 +33,16 @@ class Job:
|
|
27
33
|
|
28
34
|
TODO: make a non-static member function
|
29
35
|
"""
|
36
|
+
if "tags" in job:
|
37
|
+
raise BadWhenConfigLocation(
|
38
|
+
"'tags' should be listed inside the 'when' config for jobs"
|
39
|
+
)
|
40
|
+
|
41
|
+
if "phase" in job:
|
42
|
+
raise BadWhenConfigLocation(
|
43
|
+
"'phase' should be listed inside the 'when' config for jobs"
|
44
|
+
)
|
45
|
+
|
30
46
|
if "when" not in job or "tags" not in job["when"]:
|
31
47
|
# handle the special case where we have No tags
|
32
48
|
return None
|
@@ -3,8 +3,10 @@ import typing
|
|
3
3
|
|
4
4
|
from typing_extensions import Unpack
|
5
5
|
|
6
|
+
from runem.config_metadata import ConfigMetadata
|
6
7
|
from runem.run_command import run_command
|
7
8
|
from runem.types.common import FilePathList
|
9
|
+
from runem.types.options import OptionsWritable
|
8
10
|
from runem.types.runem_config import JobConfig
|
9
11
|
from runem.types.types_jobs import AllKwargs
|
10
12
|
|
@@ -36,8 +38,24 @@ def job_runner_simple_command(
|
|
36
38
|
"{file_list}", " ".join(file_list_with_quotes)
|
37
39
|
)
|
38
40
|
|
41
|
+
config_metadata: ConfigMetadata = kwargs["config_metadata"]
|
42
|
+
options: OptionsWritable = config_metadata.options
|
43
|
+
command_string_options: str = command_string_files
|
44
|
+
for name, value in options.items():
|
45
|
+
# For now, just pass `--option-name`, `--check` or similar to the
|
46
|
+
# command line. At some point we will want this to be cleverer, but
|
47
|
+
# this will do for now.
|
48
|
+
option_search = f"{{{name}}}"
|
49
|
+
if option_search in command_string_files:
|
50
|
+
replacement = ""
|
51
|
+
if value:
|
52
|
+
replacement = f"--{name}"
|
53
|
+
command_string_options = command_string_options.replace(
|
54
|
+
option_search, replacement
|
55
|
+
)
|
56
|
+
|
39
57
|
# use shlex to handle parsing of the command string, a non-trivial problem.
|
40
|
-
cmd = validate_simple_command(
|
58
|
+
cmd = validate_simple_command(command_string_options)
|
41
59
|
|
42
60
|
# preserve quotes for consistent handling of strings and avoid the "word
|
43
61
|
# splitting" problem for unix-like shells.
|
@@ -1,4 +1,4 @@
|
|
1
|
-
runem/VERSION,sha256=
|
1
|
+
runem/VERSION,sha256=2RXMldbKj0euKXcT7UbU5cXZnd0p_Dxh4mO98wXytbA,6
|
2
2
|
runem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
3
3
|
runem/__main__.py,sha256=dsOiVZegpfK9JOs5n7UmbX5iwwbj7iFkEbLoVeEgAn4,136
|
4
4
|
runem/base.py,sha256=EZfR7FIlwEdU9Vfe47Wk2DOO8GQqpKxxLNKp6YHueZ4,316
|
@@ -11,10 +11,10 @@ runem/config_parse.py,sha256=sXPMA8HSUcaJoq0dUfphK181waZqnIrq20mpYOQ_XCo,13498
|
|
11
11
|
runem/files.py,sha256=59boeFvUANYOS-PllIjeKIht6lNINZ43WxahDg90oAc,4392
|
12
12
|
runem/hook_manager.py,sha256=H0TL3HCqU2mgKm_-dgCD7TsK5T1bLT4g7x6kpytMPhU,4350
|
13
13
|
runem/informative_dict.py,sha256=U7p9z78UwOT4TAfng1iDXCEyeYz6C-XZlx9Z1pWNVrI,1548
|
14
|
-
runem/job.py,sha256=
|
14
|
+
runem/job.py,sha256=NOdRQnGePPyYdmIR_6JKVFzp9nbgNGetpE13bHEHaf4,3442
|
15
15
|
runem/job_execute.py,sha256=BPkeTpeTGJs3QWa0-07DZvF1f0uKO79e4yMsTxq1UHk,4656
|
16
16
|
runem/job_filter.py,sha256=7vgG4YWJ9gyGBFjV7QbSojG5ofYoszAmxXx9HnMLkHo,5384
|
17
|
-
runem/job_runner_simple_command.py,sha256=
|
17
|
+
runem/job_runner_simple_command.py,sha256=iP5an6yixW8o4C0ZBtu6csb-oVK3Q62ZZgtHBmxlXaU,2428
|
18
18
|
runem/job_wrapper.py,sha256=q5GtopZ5vhSJ581rwU4-lF9KnbL3ZYgOC8fqaCnXD_g,983
|
19
19
|
runem/job_wrapper_python.py,sha256=rx7J_N-JXs8GgMq7Sla7B9s_ZAfofKUhEnzgMcq_bts,4303
|
20
20
|
runem/log.py,sha256=dIrocigvIJs1ZGkAzTogXkAK-0ZW3q5FkjpDgLdeW-E,630
|
@@ -34,9 +34,9 @@ runem/types/runem_config.py,sha256=qG_bghm5Nr-ZTbaZbf1v8Fx447V-hgEvvRy5NZ3t-Io,5
|
|
34
34
|
runem/types/types_jobs.py,sha256=wqiiBmRIJDbGlKcfOqewHGKx350w0p4_7pysMm7xGmo,4906
|
35
35
|
tests/test_types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
36
|
tests/test_types/test_public_api.py,sha256=QHiwt7CetQur65JSbFRnOzQxhCJkX5MVLymHHVd_6yc,160
|
37
|
-
runem-0.
|
38
|
-
runem-0.
|
39
|
-
runem-0.
|
40
|
-
runem-0.
|
41
|
-
runem-0.
|
42
|
-
runem-0.
|
37
|
+
runem-0.3.0.dist-info/LICENSE,sha256=awOCsWJ58m_2kBQwBUGWejVqZm6wuRtCL2hi9rfa0X4,1211
|
38
|
+
runem-0.3.0.dist-info/METADATA,sha256=60xJCeO4__eyLluCyFosw1UTsIbs1dyQFruOJ6iNM7I,5842
|
39
|
+
runem-0.3.0.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
40
|
+
runem-0.3.0.dist-info/entry_points.txt,sha256=nu0g_vBeuPihYtimbtlNusxWovylMppvJ8UxdJlJfvM,46
|
41
|
+
runem-0.3.0.dist-info/top_level.txt,sha256=Zu65aVeDPh8WbChU4Mi7-Md4S3XJDPuqdQjEE3DSQno,12
|
42
|
+
runem-0.3.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|