dnastack-client-library 3.1.171__py3-none-any.whl → 3.1.176__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.
- dnastack/cli/commands/workbench/workflows/commands.py +32 -6
- dnastack/cli/commands/workbench/workflows/utils.py +12 -0
- dnastack/client/workbench/workflow/client.py +1 -0
- dnastack/client/workbench/workflow/models.py +2 -0
- dnastack/constants.py +1 -1
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.176.dist-info}/METADATA +1 -1
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.176.dist-info}/RECORD +11 -11
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.176.dist-info}/WHEEL +0 -0
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.176.dist-info}/entry_points.txt +0 -0
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.176.dist-info}/licenses/LICENSE +0 -0
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.176.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,7 @@ from click import style, Group
|
|
|
7
7
|
from dnastack.cli.commands.utils import MAX_RESULTS_ARG, PAGINATION_PAGE_ARG, PAGINATION_PAGE_SIZE_ARG
|
|
8
8
|
from dnastack.cli.commands.workbench.utils import NAMESPACE_ARG, create_sort_arg
|
|
9
9
|
from dnastack.cli.commands.workbench.workflows.utils import get_workflow_client, _get_replace_patch, \
|
|
10
|
-
_get_description_patch, _get_author_patch
|
|
10
|
+
_get_description_patch, _get_author_patch, _get_labels_patch
|
|
11
11
|
from dnastack.cli.core.command import formatted_command
|
|
12
12
|
from dnastack.cli.core.command_spec import ArgumentSpec, ArgumentType, CONTEXT_ARG, SINGLE_ENDPOINT_ID_ARG
|
|
13
13
|
from dnastack.cli.helpers.exporter import to_json, normalize
|
|
@@ -190,6 +190,12 @@ def init_workflows_commands(group: Group):
|
|
|
190
190
|
arg_names=['--organization'],
|
|
191
191
|
help='Set a organization for the workflow',
|
|
192
192
|
),
|
|
193
|
+
ArgumentSpec(
|
|
194
|
+
name='labels',
|
|
195
|
+
arg_names=['--label'],
|
|
196
|
+
help='Label for the workflow. This flag can be repeated to specify multiple labels (e.g., --label tag1 --label tag2)',
|
|
197
|
+
multiple=True,
|
|
198
|
+
),
|
|
193
199
|
NAMESPACE_ARG,
|
|
194
200
|
CONTEXT_ARG,
|
|
195
201
|
SINGLE_ENDPOINT_ID_ARG,
|
|
@@ -203,7 +209,8 @@ def init_workflows_commands(group: Group):
|
|
|
203
209
|
description: FileOrValue,
|
|
204
210
|
organization: Optional[str],
|
|
205
211
|
entrypoint: str,
|
|
206
|
-
workflow_file: List[FileOrValue]
|
|
212
|
+
workflow_file: List[FileOrValue],
|
|
213
|
+
labels: List[str]):
|
|
207
214
|
"""
|
|
208
215
|
Create a new workflow
|
|
209
216
|
|
|
@@ -232,13 +239,24 @@ def init_workflows_commands(group: Group):
|
|
|
232
239
|
workflow_files_list = [loader.to_zip()]
|
|
233
240
|
entrypoint = loader.entrypoint
|
|
234
241
|
|
|
242
|
+
if labels:
|
|
243
|
+
# Filter out empty labels and strip whitespace
|
|
244
|
+
parsed_labels = [label.strip() for label in labels if label.strip()]
|
|
245
|
+
if parsed_labels:
|
|
246
|
+
label_list = ','.join(parsed_labels)
|
|
247
|
+
else:
|
|
248
|
+
label_list = None
|
|
249
|
+
else:
|
|
250
|
+
label_list = None
|
|
251
|
+
|
|
235
252
|
create_request = WorkflowCreate(
|
|
236
253
|
name=name,
|
|
237
254
|
version_name=version_name,
|
|
238
255
|
description=description.value() if description else None,
|
|
239
256
|
organization=organization,
|
|
240
257
|
entrypoint=entrypoint,
|
|
241
|
-
files=workflow_files_list
|
|
258
|
+
files=workflow_files_list,
|
|
259
|
+
labels=label_list
|
|
242
260
|
)
|
|
243
261
|
|
|
244
262
|
result = workflows_client.create_workflow(workflow_create_request=create_request)
|
|
@@ -313,7 +331,13 @@ def init_workflows_commands(group: Group):
|
|
|
313
331
|
ArgumentSpec(
|
|
314
332
|
name='authors',
|
|
315
333
|
arg_names=['--authors'],
|
|
316
|
-
help='
|
|
334
|
+
help='A list of authors to update. This value can be a comma separated list, a file or JSON literal',
|
|
335
|
+
),
|
|
336
|
+
ArgumentSpec(
|
|
337
|
+
name='labels',
|
|
338
|
+
arg_names=['--label'],
|
|
339
|
+
help='Label to apply to the workflow. This flag can be repeated to specify multiple labels (e.g., --label tag1 --label tag2)',
|
|
340
|
+
multiple=True,
|
|
317
341
|
),
|
|
318
342
|
CONTEXT_ARG,
|
|
319
343
|
SINGLE_ENDPOINT_ID_ARG,
|
|
@@ -325,7 +349,8 @@ def init_workflows_commands(group: Group):
|
|
|
325
349
|
workflow_id: str,
|
|
326
350
|
name: Optional[str],
|
|
327
351
|
description: FileOrValue,
|
|
328
|
-
authors: Optional[str]
|
|
352
|
+
authors: Optional[str],
|
|
353
|
+
labels: List[str]):
|
|
329
354
|
"""
|
|
330
355
|
Update an existing workflow
|
|
331
356
|
|
|
@@ -337,7 +362,8 @@ def init_workflows_commands(group: Group):
|
|
|
337
362
|
patch_list = [
|
|
338
363
|
_get_replace_patch("/name", name),
|
|
339
364
|
_get_description_patch(description),
|
|
340
|
-
_get_author_patch(authors)
|
|
365
|
+
_get_author_patch(authors),
|
|
366
|
+
_get_labels_patch(labels)
|
|
341
367
|
]
|
|
342
368
|
patch_list = [patch for patch in patch_list if patch]
|
|
343
369
|
|
|
@@ -202,6 +202,18 @@ def _get_replace_patch(path: str, value: str) -> Union[JsonPatch, None]:
|
|
|
202
202
|
return None
|
|
203
203
|
|
|
204
204
|
|
|
205
|
+
def _get_labels_patch(labels: Optional[List[str]]) -> Union[JsonPatch, None]:
|
|
206
|
+
if labels is None or len(labels) == 0:
|
|
207
|
+
return None
|
|
208
|
+
|
|
209
|
+
# Clean and validate labels
|
|
210
|
+
cleaned_labels = [label.strip() for label in labels if label and label.strip()]
|
|
211
|
+
if not cleaned_labels:
|
|
212
|
+
return JsonPatch(path="/labels", op="remove")
|
|
213
|
+
|
|
214
|
+
return JsonPatch(path="/labels", op="replace", value=cleaned_labels)
|
|
215
|
+
|
|
216
|
+
|
|
205
217
|
class JavaScriptFunctionExtractor:
|
|
206
218
|
FUNCTION_PATTERN = re.compile(r'(?:let|const)\s*\w+\s*=\s*(\(.*\)\s*=>\s*\{.*\})', re.DOTALL)
|
|
207
219
|
|
|
@@ -220,6 +220,7 @@ class WorkflowClient(BaseWorkbenchClient):
|
|
|
220
220
|
'organization': (None, workflow_create_request.organization),
|
|
221
221
|
'description': (None, workflow_create_request.description),
|
|
222
222
|
'entrypoint': (None, workflow_create_request.entrypoint),
|
|
223
|
+
'labels': (None, workflow_create_request.labels)
|
|
223
224
|
}
|
|
224
225
|
response = session.post(
|
|
225
226
|
urljoin(self.endpoint.url, f'{self.namespace}/workflows'),
|
|
@@ -41,6 +41,7 @@ class Workflow(BaseModel):
|
|
|
41
41
|
versions: Optional[List[WorkflowVersion]]
|
|
42
42
|
deleted: Optional[bool]
|
|
43
43
|
etag: Optional[str]
|
|
44
|
+
labels: Optional[List[str]]
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
class WorkflowFileType(str, Enum):
|
|
@@ -72,6 +73,7 @@ class WorkflowCreate(BaseModel):
|
|
|
72
73
|
version_name: Optional[str] = None
|
|
73
74
|
entrypoint: str
|
|
74
75
|
files: List[Path]
|
|
76
|
+
labels: Optional[str] = None
|
|
75
77
|
|
|
76
78
|
|
|
77
79
|
class WorkflowVersionCreate(BaseModel):
|
dnastack/constants.py
CHANGED
{dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.176.dist-info}/RECORD
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
dnastack/__init__.py,sha256=mslf7se8vBSK_HkqWTGPdibeVhT4xyKXgzQBV7dEK1M,333
|
|
2
2
|
dnastack/__main__.py,sha256=EKmtIs4TBseQJi-OT_U6LqRyKLiyrGTBuTQg9zE-G2I,4376
|
|
3
|
-
dnastack/constants.py,sha256=
|
|
3
|
+
dnastack/constants.py,sha256=0ctvdp7uEjEx-1RcQge1ARbYyqF9nN5FUtMjwD2KoYk,114
|
|
4
4
|
dnastack/feature_flags.py,sha256=RK_V_Ovncoe6NeTheAA_frP-kYkZC1fDlTbbup2KYG4,1419
|
|
5
5
|
dnastack/json_path.py,sha256=TyghhDf7nGQmnsUWBhenU_fKsE_Ez-HLVER6HgH5-hU,2700
|
|
6
6
|
dnastack/omics_cli.py,sha256=ZppKZTHv_XjUUZyRIzSkx0Ug5ODAYrCOTsU0ezCOVrA,3694
|
|
@@ -88,8 +88,8 @@ dnastack/cli/commands/workbench/storage/commands.py,sha256=m_h2hUhTZ24YCreavRjIc
|
|
|
88
88
|
dnastack/cli/commands/workbench/storage/update.py,sha256=man43AfkFA-9STQiSH4_SuIIgVx8GFH-RRt7ZZbc9ek,10525
|
|
89
89
|
dnastack/cli/commands/workbench/storage/utils.py,sha256=uZPN6rx14y8Wymc2uDOiGj4imSJOWbDWMm1Fmta_pYE,3204
|
|
90
90
|
dnastack/cli/commands/workbench/workflows/__init__.py,sha256=GLUXWR2UD5ZOlvfcUv2o2oz_k7mmPWU8650egt3rDfM,513
|
|
91
|
-
dnastack/cli/commands/workbench/workflows/commands.py,sha256=
|
|
92
|
-
dnastack/cli/commands/workbench/workflows/utils.py,sha256=
|
|
91
|
+
dnastack/cli/commands/workbench/workflows/commands.py,sha256=opDNFNXHAdNL9pKy7LEdTlmm0HCASOgQ6seD9dd_eTE,15114
|
|
92
|
+
dnastack/cli/commands/workbench/workflows/utils.py,sha256=9cEmJUy5MgrQShygc-PrBvX2AIMbfKsucj1P_mA9Xx0,12463
|
|
93
93
|
dnastack/cli/commands/workbench/workflows/versions/__init__.py,sha256=tiVcCClMNuxmBwJEJQrvm8_t-ytzjOHaILAfAGFCoQY,979
|
|
94
94
|
dnastack/cli/commands/workbench/workflows/versions/commands.py,sha256=fS5YrQcTSbHUig8kDuD3daWatZtXnopUT4eyWuzQT5w,16150
|
|
95
95
|
dnastack/cli/commands/workbench/workflows/versions/defaults.py,sha256=NoDsUpkrFFLzw9J6l3ebdViwt6OaNFrmGxjv3yBFMak,12265
|
|
@@ -151,8 +151,8 @@ dnastack/client/workbench/workbench_user_service/__init__.py,sha256=47DEQpj8HBSa
|
|
|
151
151
|
dnastack/client/workbench/workbench_user_service/client.py,sha256=ZpMOFw5L3NxbC2WtKpH3OJ435zEjy0-m4p0WgzQEOB0,1219
|
|
152
152
|
dnastack/client/workbench/workbench_user_service/models.py,sha256=P8WmocouYthi4gnHzNJT2F3iExWTt_2MUnskexN6Rxs,126
|
|
153
153
|
dnastack/client/workbench/workflow/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
154
|
-
dnastack/client/workbench/workflow/client.py,sha256=
|
|
155
|
-
dnastack/client/workbench/workflow/models.py,sha256=
|
|
154
|
+
dnastack/client/workbench/workflow/client.py,sha256=XBhfKhIrjhnszGU_195CPPiEwr8Olzqe2BmYlNHhhCE,22309
|
|
155
|
+
dnastack/client/workbench/workflow/models.py,sha256=IYGityy8eqkS4ykfkx654DBtEpTQeMp2PJETJA1Y4jM,5570
|
|
156
156
|
dnastack/client/workbench/workflow/utils.py,sha256=Yw9X-Gtu5lYPDCZjimFJMhrib9ELl07YyD4A-L8Y7pE,4661
|
|
157
157
|
dnastack/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
158
158
|
dnastack/common/auth_manager.py,sha256=AFMDIR01AQ2EPNyUZ7RMS8A8FvdRUMEhLtFjTd5Mdqw,9051
|
|
@@ -196,9 +196,9 @@ dnastack/http/authenticators/oauth2_adapter/device_code_flow.py,sha256=dXI5CyUcs
|
|
|
196
196
|
dnastack/http/authenticators/oauth2_adapter/factory.py,sha256=ZtNXOklWEim-26ooNoPp3ji_hRg1vf4fHHnY94F0wLI,1087
|
|
197
197
|
dnastack/http/authenticators/oauth2_adapter/models.py,sha256=iY7asrSElyjubInrGV5rJKKZAxJWeq7csnaj-EqMq00,943
|
|
198
198
|
dnastack/http/authenticators/oauth2_adapter/token_exchange.py,sha256=nSuAsSKWa_UNqHSbPMOEk4komaFITYAnE04Sk5WOrLc,6332
|
|
199
|
-
dnastack_client_library-3.1.
|
|
200
|
-
dnastack_client_library-3.1.
|
|
201
|
-
dnastack_client_library-3.1.
|
|
202
|
-
dnastack_client_library-3.1.
|
|
203
|
-
dnastack_client_library-3.1.
|
|
204
|
-
dnastack_client_library-3.1.
|
|
199
|
+
dnastack_client_library-3.1.176.dist-info/licenses/LICENSE,sha256=uwybO-wUbQhxkosgjhJlxmYATMy-AzoULFO9FUedE34,11580
|
|
200
|
+
dnastack_client_library-3.1.176.dist-info/METADATA,sha256=UYRTL_7-fiulgFqCrGyLrlgPvxItaJXjlwwU1li1pxs,1766
|
|
201
|
+
dnastack_client_library-3.1.176.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
202
|
+
dnastack_client_library-3.1.176.dist-info/entry_points.txt,sha256=Y6OeicsiyGn3-8D-SiV4NiKlJgXfkSqK88kFBR6R1rY,89
|
|
203
|
+
dnastack_client_library-3.1.176.dist-info/top_level.txt,sha256=P2RgRyqJ7hfNy1wLVRoVLJYEppUVkCX3syGK9zBqkt8,9
|
|
204
|
+
dnastack_client_library-3.1.176.dist-info/RECORD,,
|
{dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.176.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|