workpeg 0.4.0__tar.gz → 0.4.1__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.
- {workpeg-0.4.0/src/workpeg.egg-info → workpeg-0.4.1}/PKG-INFO +1 -1
- {workpeg-0.4.0 → workpeg-0.4.1}/pyproject.toml +1 -1
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/submit.py +10 -10
- {workpeg-0.4.0 → workpeg-0.4.1/src/workpeg.egg-info}/PKG-INFO +1 -1
- {workpeg-0.4.0 → workpeg-0.4.1}/LICENSE +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/MANIFEST.in +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/README.md +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/setup.cfg +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/__init__.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/build.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/cli.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/config.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/context.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/create_new.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/run.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/runtime.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/templates/__init__.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/templates/functions/Dockerfile +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/templates/functions/LICENSE +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/templates/functions/README.md +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/templates/functions/app/__init__.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/templates/functions/app/main.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg/templates/functions/requirements.txt +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg.egg-info/SOURCES.txt +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg.egg-info/dependency_links.txt +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg.egg-info/entry_points.txt +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg.egg-info/requires.txt +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/src/workpeg.egg-info/top_level.txt +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/tests/test_build.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/tests/test_cli.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/tests/test_context.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/tests/test_create_new.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/tests/test_run.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/tests/test_runtime.py +0 -0
- {workpeg-0.4.0 → workpeg-0.4.1}/tests/test_submit.py +0 -0
|
@@ -24,20 +24,20 @@ def _fail(msg: str, code: int = 2) -> None:
|
|
|
24
24
|
|
|
25
25
|
def parse_ref(ref: str) -> Tuple[str, str]:
|
|
26
26
|
"""
|
|
27
|
-
Parse "
|
|
27
|
+
Parse "branch_name:version"
|
|
28
28
|
"""
|
|
29
29
|
if ":" not in ref:
|
|
30
|
-
_fail("Expected <
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
_fail("Expected <branch_name>:<version> (example: fn_echo:1.0.0)")
|
|
31
|
+
branch_name, version = ref.split(":", 1)
|
|
32
|
+
branch_name = branch_name.strip()
|
|
33
33
|
version = version.strip()
|
|
34
34
|
|
|
35
|
-
if not
|
|
36
|
-
_fail("
|
|
35
|
+
if not branch_name:
|
|
36
|
+
_fail("branch_name is empty")
|
|
37
37
|
if not version:
|
|
38
38
|
_fail("version is empty")
|
|
39
39
|
|
|
40
|
-
return
|
|
40
|
+
return branch_name, version
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
def decode_jwt_payload_no_verify(token: str) -> dict:
|
|
@@ -143,7 +143,7 @@ def main(argv=None) -> None:
|
|
|
143
143
|
description="Submit a Workpeg function bundle to a Peg.")
|
|
144
144
|
parser.add_argument(
|
|
145
145
|
"ref",
|
|
146
|
-
help="Function reference in the form <
|
|
146
|
+
help="Function reference in the form <branch_name>:<version>"
|
|
147
147
|
" (e.g., fn_echo:1.0.0)")
|
|
148
148
|
parser.add_argument("--api", default=os.environ.get(API_ENV,
|
|
149
149
|
DEFAULT_API_BASE), help="API base URL")
|
|
@@ -157,7 +157,7 @@ def main(argv=None) -> None:
|
|
|
157
157
|
if not token:
|
|
158
158
|
_fail(f"Missing env var {JWT_ENV}")
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
branch_name, version = parse_ref(args.ref)
|
|
161
161
|
|
|
162
162
|
payload = decode_jwt_payload_no_verify(token)
|
|
163
163
|
peg_id = payload.get("peg_namespace")
|
|
@@ -173,7 +173,7 @@ def main(argv=None) -> None:
|
|
|
173
173
|
api_base=args.api,
|
|
174
174
|
peg_id=str(peg_id),
|
|
175
175
|
token=token,
|
|
176
|
-
function_id=
|
|
176
|
+
function_id=branch_name,
|
|
177
177
|
version=version,
|
|
178
178
|
bundle_bytes=bundle_bytes,
|
|
179
179
|
timeout_s=args.timeout,
|
|
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
|