dnastack-client-library 3.1.171__py3-none-any.whl → 3.1.174__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 +30 -6
- dnastack/cli/commands/workbench/workflows/utils.py +14 -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.174.dist-info}/METADATA +1 -1
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.174.dist-info}/RECORD +11 -11
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.174.dist-info}/WHEEL +0 -0
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.174.dist-info}/entry_points.txt +0 -0
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.174.dist-info}/licenses/LICENSE +0 -0
- {dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.174.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,11 @@ 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=['--labels'],
|
|
196
|
+
help='Comma-separated list of labels for the workflow (e.g., "tag1,tag2,tag3")',
|
|
197
|
+
),
|
|
193
198
|
NAMESPACE_ARG,
|
|
194
199
|
CONTEXT_ARG,
|
|
195
200
|
SINGLE_ENDPOINT_ID_ARG,
|
|
@@ -203,7 +208,8 @@ def init_workflows_commands(group: Group):
|
|
|
203
208
|
description: FileOrValue,
|
|
204
209
|
organization: Optional[str],
|
|
205
210
|
entrypoint: str,
|
|
206
|
-
workflow_file: List[FileOrValue]
|
|
211
|
+
workflow_file: List[FileOrValue],
|
|
212
|
+
labels: Optional[str]):
|
|
207
213
|
"""
|
|
208
214
|
Create a new workflow
|
|
209
215
|
|
|
@@ -232,13 +238,24 @@ def init_workflows_commands(group: Group):
|
|
|
232
238
|
workflow_files_list = [loader.to_zip()]
|
|
233
239
|
entrypoint = loader.entrypoint
|
|
234
240
|
|
|
241
|
+
if labels:
|
|
242
|
+
# Parse and validate labels, but keep as string for WorkflowCreate
|
|
243
|
+
parsed_labels = [label.strip() for label in labels.split(',') if label.strip()]
|
|
244
|
+
if parsed_labels:
|
|
245
|
+
label_list = ','.join(parsed_labels)
|
|
246
|
+
else:
|
|
247
|
+
label_list = None
|
|
248
|
+
else:
|
|
249
|
+
label_list = None
|
|
250
|
+
|
|
235
251
|
create_request = WorkflowCreate(
|
|
236
252
|
name=name,
|
|
237
253
|
version_name=version_name,
|
|
238
254
|
description=description.value() if description else None,
|
|
239
255
|
organization=organization,
|
|
240
256
|
entrypoint=entrypoint,
|
|
241
|
-
files=workflow_files_list
|
|
257
|
+
files=workflow_files_list,
|
|
258
|
+
labels=label_list
|
|
242
259
|
)
|
|
243
260
|
|
|
244
261
|
result = workflows_client.create_workflow(workflow_create_request=create_request)
|
|
@@ -313,7 +330,12 @@ def init_workflows_commands(group: Group):
|
|
|
313
330
|
ArgumentSpec(
|
|
314
331
|
name='authors',
|
|
315
332
|
arg_names=['--authors'],
|
|
316
|
-
help='
|
|
333
|
+
help='A list of authors to update. This value can be a comma separated list, a file or JSON literal',
|
|
334
|
+
),
|
|
335
|
+
ArgumentSpec(
|
|
336
|
+
name='labels',
|
|
337
|
+
arg_names=['--labels'],
|
|
338
|
+
help='A list of labels to apply. This value can be a comma separated list, a file or JSON literal',
|
|
317
339
|
),
|
|
318
340
|
CONTEXT_ARG,
|
|
319
341
|
SINGLE_ENDPOINT_ID_ARG,
|
|
@@ -325,7 +347,8 @@ def init_workflows_commands(group: Group):
|
|
|
325
347
|
workflow_id: str,
|
|
326
348
|
name: Optional[str],
|
|
327
349
|
description: FileOrValue,
|
|
328
|
-
authors: Optional[str]
|
|
350
|
+
authors: Optional[str],
|
|
351
|
+
labels: Optional[str]):
|
|
329
352
|
"""
|
|
330
353
|
Update an existing workflow
|
|
331
354
|
|
|
@@ -337,7 +360,8 @@ def init_workflows_commands(group: Group):
|
|
|
337
360
|
patch_list = [
|
|
338
361
|
_get_replace_patch("/name", name),
|
|
339
362
|
_get_description_patch(description),
|
|
340
|
-
_get_author_patch(authors)
|
|
363
|
+
_get_author_patch(authors),
|
|
364
|
+
_get_labels_patch(labels)
|
|
341
365
|
]
|
|
342
366
|
patch_list = [patch for patch in patch_list if patch]
|
|
343
367
|
|
|
@@ -202,6 +202,20 @@ 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[str]) -> Union[JsonPatch, None]:
|
|
206
|
+
if labels is None:
|
|
207
|
+
return None
|
|
208
|
+
if labels.strip() == "":
|
|
209
|
+
return JsonPatch(path="/labels", op="remove")
|
|
210
|
+
|
|
211
|
+
# Clean and validate labels
|
|
212
|
+
cleaned_labels = [label.strip() for label in labels.split(",") if label.strip()]
|
|
213
|
+
if not cleaned_labels:
|
|
214
|
+
return JsonPatch(path="/labels", op="remove")
|
|
215
|
+
|
|
216
|
+
return JsonPatch(path="/labels", op="replace", value=cleaned_labels)
|
|
217
|
+
|
|
218
|
+
|
|
205
219
|
class JavaScriptFunctionExtractor:
|
|
206
220
|
FUNCTION_PATTERN = re.compile(r'(?:let|const)\s*\w+\s*=\s*(\(.*\)\s*=>\s*\{.*\})', re.DOTALL)
|
|
207
221
|
|
|
@@ -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.174.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=vbKzJJ---CEwR9P2AZ8zLB38xcayn3Rx2YAgVujUQC8,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=EHNNx3uN2SpZobw6jc0a-EFC7C4NZpPP4AR7a0wOdv8,15028
|
|
92
|
+
dnastack/cli/commands/workbench/workflows/utils.py,sha256=0k31Gud5E4Vgxkd-Di_7PrcxBwx4FMOg1DSAy2PsZhk,12517
|
|
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.174.dist-info/licenses/LICENSE,sha256=uwybO-wUbQhxkosgjhJlxmYATMy-AzoULFO9FUedE34,11580
|
|
200
|
+
dnastack_client_library-3.1.174.dist-info/METADATA,sha256=JU8SXKzCq8yUGGEQi9Jw-xFnmNbY1UTTRjpXfOKNoqU,1766
|
|
201
|
+
dnastack_client_library-3.1.174.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
202
|
+
dnastack_client_library-3.1.174.dist-info/entry_points.txt,sha256=Y6OeicsiyGn3-8D-SiV4NiKlJgXfkSqK88kFBR6R1rY,89
|
|
203
|
+
dnastack_client_library-3.1.174.dist-info/top_level.txt,sha256=P2RgRyqJ7hfNy1wLVRoVLJYEppUVkCX3syGK9zBqkt8,9
|
|
204
|
+
dnastack_client_library-3.1.174.dist-info/RECORD,,
|
{dnastack_client_library-3.1.171.dist-info → dnastack_client_library-3.1.174.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|