workflow.core 1.7.0__tar.gz → 1.8.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.7.0 → workflow_core-1.8.0}/PKG-INFO +1 -1
- {workflow_core-1.7.0 → workflow_core-1.8.0}/pyproject.toml +1 -1
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/definitions/config.py +7 -1
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/definitions/work.py +6 -7
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/lifecycle/execute.py +6 -1
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/validate.py +1 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/README.md +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/buckets.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/configs.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/main.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/pipelines.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/results.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/run.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/schedules.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/cli/workspace.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/daemons/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/daemons/audit.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/daemons/transfer.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/definitions/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/definitions/jsonschema.md +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/definitions/notify.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/definitions/workspace.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/examples/function.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/examples/sample.svg +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/examples/sample.workflow.yml +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/exceptions.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/helpers/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/helpers/date.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/http/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/http/buckets.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/http/client.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/http/configs.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/http/context.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/http/pipelines.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/http/results.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/http/schedules.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/lifecycle/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/lifecycle/archive/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/lifecycle/archive/http.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/lifecycle/archive/posix.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/lifecycle/archive/s3.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/lifecycle/attempt.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/lifecycle/configure.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/decorators.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/logger.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/prompt.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/read.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/renderers.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/tmate.sh +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/variables.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/utils/write.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/workspaces/__init__.py +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/workspaces/chimefrb.yml +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/workspaces/development.yml +0 -0
- {workflow_core-1.7.0 → workflow_core-1.8.0}/workflow/workspaces/site-dev.yml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Work Object Configuration."""
|
|
2
2
|
|
|
3
|
-
from typing import List, Optional
|
|
3
|
+
from typing import List, Literal, Optional
|
|
4
4
|
|
|
5
5
|
from pydantic import Field, field_validator
|
|
6
6
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
@@ -122,3 +122,9 @@ class Config(BaseSettings):
|
|
|
122
122
|
""",
|
|
123
123
|
examples=[["developers", "admins"]],
|
|
124
124
|
)
|
|
125
|
+
strategy: Literal["strict", "relaxed"] = Field(
|
|
126
|
+
default="strict",
|
|
127
|
+
description="Validation strategy for the work.",
|
|
128
|
+
examples=["strict"],
|
|
129
|
+
exclude=True,
|
|
130
|
+
)
|
|
@@ -360,13 +360,12 @@ class Work(BaseSettings):
|
|
|
360
360
|
Work: The current work object.
|
|
361
361
|
"""
|
|
362
362
|
# Validate if the site provided is allowed in the workspace.
|
|
363
|
-
config
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
f"site
|
|
368
|
-
|
|
369
|
-
raise ValueError(error)
|
|
363
|
+
if self.config.strategy == "strict":
|
|
364
|
+
config: Dict[str, Any] = read.workspace(self.workspace)
|
|
365
|
+
sites: List[str] = config.get("sites", [])
|
|
366
|
+
if self.site not in sites:
|
|
367
|
+
error = f"site {self.site} not in workspace: {sites}."
|
|
368
|
+
raise ValueError(error)
|
|
370
369
|
return self
|
|
371
370
|
|
|
372
371
|
###########################################################################
|
|
@@ -95,11 +95,16 @@ def command(work: Work) -> Work:
|
|
|
95
95
|
try:
|
|
96
96
|
assert isinstance(work.command, list), "missing command to execute"
|
|
97
97
|
validate.command(work.command[0])
|
|
98
|
+
to_run: Union[str, List[str]] = work.command
|
|
99
|
+
if len(to_run) == 1:
|
|
100
|
+
to_run = to_run[0]
|
|
101
|
+
is_shell = isinstance(to_run, str)
|
|
98
102
|
process = subprocess.run(
|
|
99
|
-
|
|
103
|
+
to_run,
|
|
100
104
|
stdout=subprocess.PIPE,
|
|
101
105
|
stderr=subprocess.PIPE,
|
|
102
106
|
timeout=work.timeout,
|
|
107
|
+
shell=is_shell, # nosec
|
|
103
108
|
)
|
|
104
109
|
# Check return code
|
|
105
110
|
process.check_returncode()
|
|
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
|