scientiflow-cli 0.4.5__py3-none-any.whl → 0.4.6__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.
- scientiflow_cli/pipeline/decode_and_execute.py +18 -4
- {scientiflow_cli-0.4.5.dist-info → scientiflow_cli-0.4.6.dist-info}/METADATA +1 -1
- {scientiflow_cli-0.4.5.dist-info → scientiflow_cli-0.4.6.dist-info}/RECORD +6 -6
- {scientiflow_cli-0.4.5.dist-info → scientiflow_cli-0.4.6.dist-info}/LICENSE.md +0 -0
- {scientiflow_cli-0.4.5.dist-info → scientiflow_cli-0.4.6.dist-info}/WHEEL +0 -0
- {scientiflow_cli-0.4.5.dist-info → scientiflow_cli-0.4.6.dist-info}/entry_points.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import subprocess
|
|
2
2
|
import tempfile
|
|
3
3
|
import os
|
|
4
|
-
import re
|
|
4
|
+
import re, shlex
|
|
5
5
|
import multiprocessing
|
|
6
6
|
import threading
|
|
7
7
|
from concurrent.futures import ProcessPoolExecutor, as_completed
|
|
@@ -114,9 +114,23 @@ class PipelineExecutor:
|
|
|
114
114
|
print(f"[ERROR] Failed to update terminal output: {e}")
|
|
115
115
|
|
|
116
116
|
def replace_variables(self, command: str) -> str:
|
|
117
|
-
"""Replace placeholders like ${VAR} with environment values."""
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
# """Replace placeholders like ${VAR} with environment values."""
|
|
118
|
+
# print(self.environment_variables)
|
|
119
|
+
# return re.sub(r'\$\{(\w+)\}', lambda m: self.environment_variables.get(m.group(1), m.group(0)), command)
|
|
120
|
+
"""Replace placeholders like ${VAR} with environment values.
|
|
121
|
+
- If value is a list: safely join into space-separated arguments (quoted).
|
|
122
|
+
- Otherwise: use the old behavior (direct substitution).
|
|
123
|
+
"""
|
|
124
|
+
def replacer(match):
|
|
125
|
+
key = match.group(1)
|
|
126
|
+
value = self.environment_variables.get(key, match.group(0))
|
|
127
|
+
# ✅ Special handling for lists
|
|
128
|
+
if isinstance(value, list):
|
|
129
|
+
return " ".join(shlex.quote(str(v)) for v in value)
|
|
130
|
+
# ✅ Default: keep original behavior for strings, numbers, None
|
|
131
|
+
return self.environment_variables.get(key, match.group(0))
|
|
132
|
+
return re.sub(r'\$\{(\w+)\}', replacer, command)
|
|
133
|
+
|
|
120
134
|
def execute_command(self, command: str):
|
|
121
135
|
"""Run the command in the terminal, display output in real-time, and log the captured output."""
|
|
122
136
|
import sys
|
|
@@ -8,7 +8,7 @@ scientiflow_cli/config.py,sha256=MlNscMiu7G9VsZxqQFYVuU6_HKhGC7Y9pU0yRZPN9Ms,337
|
|
|
8
8
|
scientiflow_cli/main.py,sha256=PbZRL4GatzXVK95GGPWJnpBCKPqyn1dVmiwNHDyjXkU,6584
|
|
9
9
|
scientiflow_cli/pipeline/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
scientiflow_cli/pipeline/container_manager.py,sha256=KAnE5AvsSg4cewLc_v4gWCqhKGoc7ycHOtl_HYxUK7E,8444
|
|
11
|
-
scientiflow_cli/pipeline/decode_and_execute.py,sha256=
|
|
11
|
+
scientiflow_cli/pipeline/decode_and_execute.py,sha256=UhmIQrFxhJvtwqcbFIeg1wiDt2DAhVowASKiYSl5mDk,18257
|
|
12
12
|
scientiflow_cli/pipeline/get_jobs.py,sha256=69jOIVwXd8j2lAYy28r2QcsjFT4yRpXNOqsfopiZhFs,1498
|
|
13
13
|
scientiflow_cli/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
scientiflow_cli/services/auth_service.py,sha256=lknARfVTjRCH-4yWVPKiS330NIVHxFw3HlQdN2Lw3Og,3343
|
|
@@ -23,8 +23,8 @@ scientiflow_cli/utils/file_manager.py,sha256=J6FBaZ0xz6OH4vcArOGj5KqKSZ2AD78HNei
|
|
|
23
23
|
scientiflow_cli/utils/logger.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
24
24
|
scientiflow_cli/utils/mock.py,sha256=UZ9cN2Qx3EAXcxnLQY5z4DQWy4jflnWFnfNTsuvnFH8,11237
|
|
25
25
|
scientiflow_cli/utils/singularity.py,sha256=jy8ep7Xa1Eg4fptNjyXLPuVN2KA8l4dFil-w-KaVNkw,4956
|
|
26
|
-
scientiflow_cli-0.4.
|
|
27
|
-
scientiflow_cli-0.4.
|
|
28
|
-
scientiflow_cli-0.4.
|
|
29
|
-
scientiflow_cli-0.4.
|
|
30
|
-
scientiflow_cli-0.4.
|
|
26
|
+
scientiflow_cli-0.4.6.dist-info/LICENSE.md,sha256=nb6GGGYuS_KXe33mSNwcEW-QzvwM475NQ4cNE7KBb34,425
|
|
27
|
+
scientiflow_cli-0.4.6.dist-info/METADATA,sha256=rf9_MkUiB5am5x6W4laHvD_yVH_1uBO1k1dhxFBg6fk,2491
|
|
28
|
+
scientiflow_cli-0.4.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
29
|
+
scientiflow_cli-0.4.6.dist-info/entry_points.txt,sha256=0lq2mjcG5hGfODrQodeMSAy9RfE2EX1MZSHRpfSncxc,61
|
|
30
|
+
scientiflow_cli-0.4.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|