workpeg 0.2.1__tar.gz → 0.3.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.
Files changed (36) hide show
  1. {workpeg-0.2.1/src/workpeg.egg-info → workpeg-0.3.0}/PKG-INFO +1 -1
  2. {workpeg-0.2.1 → workpeg-0.3.0}/pyproject.toml +4 -4
  3. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/__init__.py +1 -1
  4. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/build.py +2 -2
  5. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/cli.py +1 -1
  6. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/config.py +1 -1
  7. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/create_new.py +4 -4
  8. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/run.py +3 -3
  9. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/runtime.py +1 -1
  10. {workpeg-0.2.1 → workpeg-0.3.0/src/workpeg.egg-info}/PKG-INFO +1 -1
  11. workpeg-0.3.0/src/workpeg.egg-info/SOURCES.txt +31 -0
  12. workpeg-0.3.0/src/workpeg.egg-info/entry_points.txt +2 -0
  13. workpeg-0.3.0/src/workpeg.egg-info/top_level.txt +1 -0
  14. {workpeg-0.2.1 → workpeg-0.3.0}/tests/test_build.py +1 -1
  15. {workpeg-0.2.1 → workpeg-0.3.0}/tests/test_cli.py +1 -1
  16. {workpeg-0.2.1 → workpeg-0.3.0}/tests/test_create_new.py +1 -1
  17. {workpeg-0.2.1 → workpeg-0.3.0}/tests/test_run.py +1 -1
  18. {workpeg-0.2.1 → workpeg-0.3.0}/tests/test_runtime.py +1 -1
  19. {workpeg-0.2.1 → workpeg-0.3.0}/tests/test_submit.py +7 -7
  20. workpeg-0.2.1/src/workpeg.egg-info/SOURCES.txt +0 -31
  21. workpeg-0.2.1/src/workpeg.egg-info/entry_points.txt +0 -2
  22. workpeg-0.2.1/src/workpeg.egg-info/top_level.txt +0 -1
  23. {workpeg-0.2.1 → workpeg-0.3.0}/LICENSE +0 -0
  24. {workpeg-0.2.1 → workpeg-0.3.0}/MANIFEST.in +0 -0
  25. {workpeg-0.2.1 → workpeg-0.3.0}/README.md +0 -0
  26. {workpeg-0.2.1 → workpeg-0.3.0}/setup.cfg +0 -0
  27. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/submit.py +0 -0
  28. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/templates/__init__.py +0 -0
  29. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/templates/functions/Dockerfile +0 -0
  30. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/templates/functions/LICENSE +0 -0
  31. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/templates/functions/README.md +0 -0
  32. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/templates/functions/app/__init__.py +0 -0
  33. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/templates/functions/app/main.py +0 -0
  34. {workpeg-0.2.1/src/workpeg_sdk → workpeg-0.3.0/src/workpeg}/templates/functions/requirements.txt +0 -0
  35. {workpeg-0.2.1 → workpeg-0.3.0}/src/workpeg.egg-info/dependency_links.txt +0 -0
  36. {workpeg-0.2.1 → workpeg-0.3.0}/src/workpeg.egg-info/requires.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: workpeg
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: Workpeg function runtime and SDK
5
5
  Author-email: Workpeg <support@workpeg.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "workpeg"
7
- version = "0.2.1"
7
+ version = "0.3.0"
8
8
  description = "Workpeg function runtime and SDK"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -29,20 +29,20 @@ Homepage = "https://gitlab.com/workpeg/workpeg"
29
29
  Repository = "https://gitlab.com/workpeg/workpeg"
30
30
 
31
31
  [project.scripts]
32
- workpeg = "workpeg_sdk.cli:main"
32
+ workpeg = "workpeg.cli:main"
33
33
 
34
34
  [tool.setuptools]
35
35
  package-dir = {"" = "src"}
36
36
 
37
37
  [tool.setuptools.package-data]
38
- workpeg_sdk = ["templates/**"]
38
+ workpeg = ["templates/**"]
39
39
 
40
40
 
41
41
  [tool.setuptools.packages.find]
42
42
  where = ["src"]
43
43
 
44
44
  [tool.setuptools.exclude-package-data]
45
- workpeg_sdk = [
45
+ workpeg = [
46
46
  "templates/**/__pycache__/**",
47
47
  "templates/**/*.pyc",
48
48
  "templates/**/*.pyo",
@@ -1,4 +1,4 @@
1
- # src/workpeg_sdk/__init__.py
1
+ # src/workpeg/__init__.py
2
2
 
3
3
  __all__ = ["__version__"]
4
4
 
@@ -1,8 +1,8 @@
1
- # src/workpeg_sdk/build.py
1
+ # src/workpeg/build.py
2
2
  import subprocess
3
3
  from pathlib import Path
4
4
 
5
- from workpeg_sdk.config import load_config
5
+ from workpeg.config import load_config
6
6
 
7
7
 
8
8
  def slugify(value: str) -> str:
@@ -1,7 +1,7 @@
1
1
  import argparse
2
2
  import sys
3
3
 
4
- from workpeg_sdk import create_new, runtime, submit, build, run
4
+ from workpeg import create_new, runtime, submit, build, run
5
5
 
6
6
  try:
7
7
  from importlib.metadata import version
@@ -1,4 +1,4 @@
1
- # src/workpeg_sdk/config.py
1
+ # src/workpeg/config.py
2
2
  import json
3
3
  from pathlib import Path
4
4
 
@@ -1,4 +1,4 @@
1
- # src/workpeg_sdk/create_new.py
1
+ # src/workpeg/create_new.py
2
2
  import argparse
3
3
  import os
4
4
  import shutil
@@ -36,14 +36,14 @@ def _copy_tree(src_root: Path, dst_root: Path, *, force: bool) -> None:
36
36
 
37
37
  def create_new_project(target_dir: str, *, force: bool = False) -> Path:
38
38
  """
39
- Copy the function template from workpeg_sdk/templates/functions/*
39
+ Copy the function template from workpeg/templates/functions/*
40
40
  into target_dir.
41
41
  """
42
42
  target = Path(target_dir).expanduser().resolve()
43
43
 
44
- # Get a Traversable pointing at .../workpeg_sdk/templates/functions
44
+ # Get a Traversable pointing at .../workpeg/templates/functions
45
45
  traversable = (
46
- pkg_resources.files("workpeg_sdk") / "templates" / "functions"
46
+ pkg_resources.files("workpeg") / "templates" / "functions"
47
47
  )
48
48
 
49
49
  # as_file() gives us a real filesystem path even if the package
@@ -1,9 +1,9 @@
1
- # src/workpeg_sdk/run.py
1
+ # src/workpeg/run.py
2
2
  import subprocess
3
3
  from pathlib import Path
4
4
 
5
- from workpeg_sdk.build import build_image
6
- from workpeg_sdk.config import load_config
5
+ from workpeg.build import build_image
6
+ from workpeg.config import load_config
7
7
 
8
8
 
9
9
  def resolve_runtime(with_runtime: str | None, config: dict) -> str:
@@ -1,4 +1,4 @@
1
- # src/workpeg_sdk/runtime.py
1
+ # src/workpeg/runtime.py
2
2
 
3
3
  import importlib
4
4
  import json
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: workpeg
3
- Version: 0.2.1
3
+ Version: 0.3.0
4
4
  Summary: Workpeg function runtime and SDK
5
5
  Author-email: Workpeg <support@workpeg.com>
6
6
  License: MIT
@@ -0,0 +1,31 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ pyproject.toml
5
+ src/workpeg/__init__.py
6
+ src/workpeg/build.py
7
+ src/workpeg/cli.py
8
+ src/workpeg/config.py
9
+ src/workpeg/create_new.py
10
+ src/workpeg/run.py
11
+ src/workpeg/runtime.py
12
+ src/workpeg/submit.py
13
+ src/workpeg.egg-info/PKG-INFO
14
+ src/workpeg.egg-info/SOURCES.txt
15
+ src/workpeg.egg-info/dependency_links.txt
16
+ src/workpeg.egg-info/entry_points.txt
17
+ src/workpeg.egg-info/requires.txt
18
+ src/workpeg.egg-info/top_level.txt
19
+ src/workpeg/templates/__init__.py
20
+ src/workpeg/templates/functions/Dockerfile
21
+ src/workpeg/templates/functions/LICENSE
22
+ src/workpeg/templates/functions/README.md
23
+ src/workpeg/templates/functions/requirements.txt
24
+ src/workpeg/templates/functions/app/__init__.py
25
+ src/workpeg/templates/functions/app/main.py
26
+ tests/test_build.py
27
+ tests/test_cli.py
28
+ tests/test_create_new.py
29
+ tests/test_run.py
30
+ tests/test_runtime.py
31
+ tests/test_submit.py
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ workpeg = workpeg.cli:main
@@ -0,0 +1 @@
1
+ workpeg
@@ -1,6 +1,6 @@
1
1
  # from pathlib import Path
2
2
 
3
- from workpeg_sdk import build
3
+ from workpeg import build
4
4
 
5
5
 
6
6
  def test_slugify():
@@ -1,6 +1,6 @@
1
1
  import pytest
2
2
 
3
- from workpeg_sdk import cli
3
+ from workpeg import cli
4
4
 
5
5
 
6
6
  def test_cli_no_args_prints_help(monkeypatch, capsys):
@@ -18,7 +18,7 @@ def test_create_new_copies_template(tmp_path):
18
18
  assert (project_dir / "app" / "__init__.py").exists()
19
19
  assert (project_dir / "app" / "main.py").exists()
20
20
 
21
- template_pkg = "workpeg_sdk.templates.functions.app"
21
+ template_pkg = "workpeg.templates.functions.app"
22
22
  template_main = pkg_resources.files(
23
23
  template_pkg).joinpath("main.py").read_text()
24
24
 
@@ -1,6 +1,6 @@
1
1
  import pytest
2
2
 
3
- from workpeg_sdk import run
3
+ from workpeg import run
4
4
 
5
5
 
6
6
  def test_resolve_runtime_prefers_flag():
@@ -4,7 +4,7 @@ import json
4
4
 
5
5
  import pytest
6
6
 
7
- from workpeg_sdk import runtime
7
+ from workpeg import runtime
8
8
 
9
9
 
10
10
  def test_parse_entrypoint_ok():
@@ -6,7 +6,7 @@ from unittest.mock import MagicMock, patch
6
6
 
7
7
  import pytest
8
8
 
9
- import workpeg_sdk.submit as submit
9
+ import workpeg.submit as submit
10
10
 
11
11
 
12
12
  # ---------- helpers ----------
@@ -144,7 +144,7 @@ def test_build_tar_gz_bytes_bad_path(tmp_path: Path):
144
144
 
145
145
  # ---------- unit tests: submit_bundle (requests.post mocked) ----------
146
146
 
147
- @patch("workpeg_sdk.submit.requests.post")
147
+ @patch("workpeg.submit.requests.post")
148
148
  def test_submit_bundle_success_builds_request(mock_post):
149
149
  mock_resp = MagicMock()
150
150
  mock_resp.status_code = 201
@@ -177,7 +177,7 @@ def test_submit_bundle_success_builds_request(mock_post):
177
177
  assert kwargs["timeout"] == 60
178
178
 
179
179
 
180
- @patch("workpeg_sdk.submit.requests.post")
180
+ @patch("workpeg.submit.requests.post")
181
181
  def test_submit_bundle_http_error_json(mock_post):
182
182
  mock_resp = MagicMock()
183
183
  mock_resp.status_code = 409
@@ -196,7 +196,7 @@ def test_submit_bundle_http_error_json(mock_post):
196
196
  assert e.value.code == 1
197
197
 
198
198
 
199
- @patch("workpeg_sdk.submit.requests.post")
199
+ @patch("workpeg.submit.requests.post")
200
200
  def test_submit_bundle_http_error_non_json(mock_post):
201
201
  mock_resp = MagicMock()
202
202
  mock_resp.status_code = 500
@@ -239,7 +239,7 @@ def test_main_jwt_missing_peg_namespace(monkeypatch, capsys):
239
239
  assert "JWT missing peg_namespace" in capsys.readouterr().err
240
240
 
241
241
 
242
- @patch("workpeg_sdk.submit.submit_bundle")
242
+ @patch("workpeg.submit.submit_bundle")
243
243
  def test_main_happy_path_uses_default_api_base(
244
244
  mock_submit_bundle, monkeypatch, tmp_path, capsys):
245
245
  # minimal project
@@ -272,7 +272,7 @@ def test_main_happy_path_uses_default_api_base(
272
272
  assert len(kwargs["bundle_bytes"]) > 0
273
273
 
274
274
 
275
- @patch("workpeg_sdk.submit.submit_bundle")
275
+ @patch("workpeg.submit.submit_bundle")
276
276
  def test_main_overrides_api_base_from_env(
277
277
  mock_submit_bundle, monkeypatch, tmp_path):
278
278
  (tmp_path / "app").mkdir()
@@ -292,7 +292,7 @@ def test_main_overrides_api_base_from_env(
292
292
  assert kwargs["peg_id"] == "peg-999"
293
293
 
294
294
 
295
- @patch("workpeg_sdk.submit.submit_bundle")
295
+ @patch("workpeg.submit.submit_bundle")
296
296
  def test_main_overrides_api_base_from_flag(
297
297
  mock_submit_bundle, monkeypatch, tmp_path):
298
298
  (tmp_path / "app").mkdir()
@@ -1,31 +0,0 @@
1
- LICENSE
2
- MANIFEST.in
3
- README.md
4
- pyproject.toml
5
- src/workpeg.egg-info/PKG-INFO
6
- src/workpeg.egg-info/SOURCES.txt
7
- src/workpeg.egg-info/dependency_links.txt
8
- src/workpeg.egg-info/entry_points.txt
9
- src/workpeg.egg-info/requires.txt
10
- src/workpeg.egg-info/top_level.txt
11
- src/workpeg_sdk/__init__.py
12
- src/workpeg_sdk/build.py
13
- src/workpeg_sdk/cli.py
14
- src/workpeg_sdk/config.py
15
- src/workpeg_sdk/create_new.py
16
- src/workpeg_sdk/run.py
17
- src/workpeg_sdk/runtime.py
18
- src/workpeg_sdk/submit.py
19
- src/workpeg_sdk/templates/__init__.py
20
- src/workpeg_sdk/templates/functions/Dockerfile
21
- src/workpeg_sdk/templates/functions/LICENSE
22
- src/workpeg_sdk/templates/functions/README.md
23
- src/workpeg_sdk/templates/functions/requirements.txt
24
- src/workpeg_sdk/templates/functions/app/__init__.py
25
- src/workpeg_sdk/templates/functions/app/main.py
26
- tests/test_build.py
27
- tests/test_cli.py
28
- tests/test_create_new.py
29
- tests/test_run.py
30
- tests/test_runtime.py
31
- tests/test_submit.py
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- workpeg = workpeg_sdk.cli:main
@@ -1 +0,0 @@
1
- workpeg_sdk
File without changes
File without changes
File without changes
File without changes