workflow.core 1.11.4__tar.gz → 1.12.0__tar.gz
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.
- {workflow_core-1.11.4 → workflow_core-1.12.0}/PKG-INFO +3 -3
- {workflow_core-1.11.4 → workflow_core-1.12.0}/pyproject.toml +1 -1
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/configs.py +28 -2
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/http/configs.py +3 -3
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/lifecycle/configure.py +23 -10
- {workflow_core-1.11.4 → workflow_core-1.12.0}/README.md +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/buckets.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/main.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/pipelines.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/results.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/run.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/schedules.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/cli/workspace.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/daemons/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/daemons/audit.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/daemons/transfer.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/definitions/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/definitions/config.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/definitions/jsonschema.md +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/definitions/notify.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/definitions/work.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/definitions/workspace.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/examples/autocomplete.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/examples/function.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/examples/sample.svg +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/examples/sample.workflow.yml +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/exceptions.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/helpers/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/helpers/date.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/http/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/http/buckets.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/http/client.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/http/context.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/http/pipelines.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/http/results.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/http/schedules.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/lifecycle/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/lifecycle/archive/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/lifecycle/archive/http.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/lifecycle/archive/posix.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/lifecycle/archive/s3.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/lifecycle/attempt.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/lifecycle/execute.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/decorators.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/format.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/logger.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/prompt.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/read.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/renderers.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/tmate.sh +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/validate.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/variables.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/utils/write.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/workspaces/__init__.py +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/workspaces/chimefrb.yml +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/workspaces/development.yml +0 -0
- {workflow_core-1.11.4 → workflow_core-1.12.0}/workflow/workspaces/site-dev.yml +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: workflow.core
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.12.0
|
|
4
4
|
Summary: Workflow Core
|
|
5
|
-
Home-page: https://github.com/chimefrb/workflow
|
|
6
5
|
License: MIT
|
|
7
6
|
Author: Shiny Brar
|
|
8
7
|
Author-email: charanjotbrar@gmail.com
|
|
@@ -14,6 +13,7 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
14
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
17
|
Requires-Dist: click (>=8.1,<9.0)
|
|
18
18
|
Requires-Dist: click-params (>=0.5,<0.6)
|
|
19
19
|
Requires-Dist: docker (>=6.1)
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"""Manage workflow pipelines."""
|
|
2
2
|
|
|
3
3
|
import json
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
4
6
|
from typing import Any, Dict, List, Optional
|
|
5
7
|
from urllib.parse import urlencode
|
|
6
8
|
|
|
@@ -69,13 +71,23 @@ def count():
|
|
|
69
71
|
type=click.Path(exists=True, dir_okay=False, readable=True),
|
|
70
72
|
required=True,
|
|
71
73
|
)
|
|
72
|
-
|
|
74
|
+
@click.option(
|
|
75
|
+
"usecanfar",
|
|
76
|
+
"--use-canfar",
|
|
77
|
+
"-uc",
|
|
78
|
+
is_flag=True,
|
|
79
|
+
default=False,
|
|
80
|
+
help="Looks for CANFAR certificate in the machine and sents it in the request.",
|
|
81
|
+
)
|
|
82
|
+
def deploy(filename: click.Path, usecanfar: bool = False):
|
|
73
83
|
"""Deploy a workflow config.
|
|
74
84
|
|
|
75
85
|
Parameters
|
|
76
86
|
----------
|
|
77
87
|
filename : click.Path
|
|
78
88
|
File path.
|
|
89
|
+
usecanfar : bool
|
|
90
|
+
Whether to look for CANFAR certificate and send it in the request.
|
|
79
91
|
"""
|
|
80
92
|
http = HTTPContext(backends=["configs"])
|
|
81
93
|
filepath: str = str(filename)
|
|
@@ -106,10 +118,24 @@ def deploy(filename: click.Path):
|
|
|
106
118
|
console.print("Cancelling", style="red")
|
|
107
119
|
return
|
|
108
120
|
|
|
121
|
+
if usecanfar:
|
|
122
|
+
console.print("Looking for CANFAR certificate...", style="bright_green")
|
|
123
|
+
cert_path = Path.home() / ".ssl" / "cadcproxy.pem"
|
|
124
|
+
cert_text = None
|
|
125
|
+
if os.path.exists(cert_path):
|
|
126
|
+
cert_text = open(cert_path).read()
|
|
127
|
+
data["canfar_cert"] = cert_text
|
|
128
|
+
console.print("CANFAR certificate found and added.", style="bright_green")
|
|
129
|
+
else:
|
|
130
|
+
console.print(
|
|
131
|
+
"CANFAR certificate not found, proceeding without it.", style="red"
|
|
132
|
+
)
|
|
133
|
+
return
|
|
134
|
+
|
|
109
135
|
try:
|
|
110
136
|
deploy_result = http.configs.deploy(data)
|
|
111
137
|
except requests.HTTPError as deploy_error:
|
|
112
|
-
console.print(deploy_error.response.json()
|
|
138
|
+
console.print(deploy_error.response.json(), style="red")
|
|
113
139
|
return
|
|
114
140
|
header_text = Text("Config deployed: ")
|
|
115
141
|
header_text.append(data["name"], style="blink underline bright_blue")
|
|
@@ -22,9 +22,9 @@ class Configs(Client):
|
|
|
22
22
|
Configs: A client for interacting with workflow-pipelines.
|
|
23
23
|
"""
|
|
24
24
|
|
|
25
|
-
@retry(
|
|
26
|
-
|
|
27
|
-
)
|
|
25
|
+
# @retry(
|
|
26
|
+
# reraise=True, wait=wait_random(min=0.3, max=1.8), stop=(stop_after_delay(15))
|
|
27
|
+
# )
|
|
28
28
|
def deploy(self, data: Dict[str, Any]):
|
|
29
29
|
"""Deploys a Config from payload data.
|
|
30
30
|
|
|
@@ -110,33 +110,46 @@ def arguments(func: Callable[..., Any], work: Work) -> List[str]:
|
|
|
110
110
|
)
|
|
111
111
|
|
|
112
112
|
if parameter_value_in_work:
|
|
113
|
-
if isinstance(parameter_value_in_work, list):
|
|
114
|
-
parameter_value_in_work = " ".join(parameter_value_in_work)
|
|
115
|
-
|
|
116
113
|
if isinstance(parameter, click.Argument):
|
|
117
114
|
# If argument, then the parameter is purely positional without a key
|
|
118
|
-
|
|
115
|
+
if isinstance(parameter_value_in_work, list):
|
|
116
|
+
for value in parameter_value_in_work:
|
|
117
|
+
args.append(f"{value}")
|
|
118
|
+
else:
|
|
119
|
+
args.append(f"{parameter_value_in_work}")
|
|
119
120
|
elif isinstance(parameter, click.Option):
|
|
120
121
|
if hasattr(parameter, "is_flag") and parameter.is_flag:
|
|
121
122
|
# If is_flag=True,
|
|
122
123
|
# then the parameter is a flag and doesn't have a value
|
|
123
124
|
args.append(f"{parameter_name_in_cli}")
|
|
124
125
|
else:
|
|
125
|
-
|
|
126
|
+
space_or_equals = ""
|
|
127
|
+
|
|
128
|
+
if len(parameter_name_in_cli) <= 2:
|
|
126
129
|
# Short options
|
|
127
130
|
# (often denoted by a single hyphen and a single letter like -r)
|
|
128
131
|
# are commonly written with a space
|
|
129
132
|
# between the option and its value
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
)
|
|
133
|
-
elif len(parameter_name_in_cli) > 2:
|
|
133
|
+
space_or_equals = " "
|
|
134
|
+
else:
|
|
134
135
|
# Long options
|
|
135
136
|
# (often denoted by two hyphens and a word like --recursive)
|
|
136
137
|
# are commonly written with an equals sign
|
|
137
138
|
# between the option and its value
|
|
139
|
+
space_or_equals = "="
|
|
140
|
+
|
|
141
|
+
if isinstance(parameter_value_in_work, list):
|
|
142
|
+
if hasattr(parameter, "multiple") and parameter.multiple:
|
|
143
|
+
for value in parameter_value_in_work:
|
|
144
|
+
args.append(
|
|
145
|
+
f"{parameter_name_in_cli}{space_or_equals}{value}"
|
|
146
|
+
)
|
|
147
|
+
elif hasattr(parameter, "nargs") and parameter.nargs:
|
|
148
|
+
values = " ".join(parameter_value_in_work)
|
|
149
|
+
args.append(f"{parameter_name_in_cli} {values}")
|
|
150
|
+
else:
|
|
138
151
|
args.append(
|
|
139
|
-
f"{parameter_name_in_cli}
|
|
152
|
+
f"{parameter_name_in_cli}{space_or_equals}{parameter_value_in_work}" # noqa
|
|
140
153
|
)
|
|
141
154
|
|
|
142
155
|
return args
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|