canvas 0.10.1__py3-none-any.whl → 0.10.2__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.

Potentially problematic release.


This version of canvas might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: canvas
3
- Version: 0.10.1
3
+ Version: 0.10.2
4
4
  Summary: SDK to customize event-driven actions in your Canvas instance
5
5
  License: MIT
6
6
  Author: Canvas Team
@@ -23,7 +23,7 @@ Requires-Dist: keyring
23
23
  Requires-Dist: protobuf (>=4.25.3,<5.0.0)
24
24
  Requires-Dist: psycopg[binary] (>=3.2.2,<4.0.0)
25
25
  Requires-Dist: pydantic (>=2.6.1,<3.0.0)
26
- Requires-Dist: pyjwt (==2.10.0)
26
+ Requires-Dist: pyjwt (==2.10.1)
27
27
  Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
28
28
  Requires-Dist: rapidfuzz (>=3.10.1,<4.0.0)
29
29
  Requires-Dist: redis (>=5.0.4,<6.0.0)
@@ -65,7 +65,7 @@ canvas_cli/apps/emit/event_fixtures/VITAL_SIGN_UPDATED.ndjson,sha256=Er0aUWIYkqb
65
65
  canvas_cli/apps/logs/__init__.py,sha256=ehY9SRb6nBw81xZF50yyBlUZJtNR2VeVSNI5sFuWJ7o,64
66
66
  canvas_cli/apps/logs/logs.py,sha256=BFpZ-2OF2Rs1EMLePo5UjqC9fKQeqm8qZobNTFNCL_M,1972
67
67
  canvas_cli/apps/plugin/__init__.py,sha256=G_nLsu6cdko5OjatnbqUyEboGcNlGGLwpZmCBxMKdfo,236
68
- canvas_cli/apps/plugin/plugin.py,sha256=pAyZQ5mNUkTvvwGLVjr8gW-4BXRh12GgTCSqinTFIb0,14832
68
+ canvas_cli/apps/plugin/plugin.py,sha256=QK0ZmnLDCb-6iV0vgsrnJv9wzfymVByjcjA-nmHTZBQ,15259
69
69
  canvas_cli/apps/plugin/tests.py,sha256=SsYeYY25ly9TMn-nkJEZjLaPCyFbT4vs1sN_FnQbJ5U,2746
70
70
  canvas_cli/apps/run_plugins/__init__.py,sha256=iAMgX_6D3CdjQodGx_azwhSjouaxquOm8Z8QVXnlTFE,117
71
71
  canvas_cli/apps/run_plugins/run_plugins.py,sha256=qsf6-UhFAZpIL-1C50fzSoIwXMsZISxg2fxzM46UHTA,384
@@ -251,7 +251,7 @@ plugin_runner/tests/test_sandbox.py,sha256=I44rz0sbxqtWm6mAG8fGhneE1yu9M-K3PMkE4
251
251
  pubsub/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
252
252
  pubsub/pubsub.py,sha256=pyTW0JU8mtaqiAV6g6xjZwel1CVy2EonPMU-_vkmhUM,1044
253
253
  settings.py,sha256=6YTybI0eNeuDamnXdRrEUOBICf9bM1uW1lCwj4IR9sU,2081
254
- canvas-0.10.1.dist-info/METADATA,sha256=SdOPhei4Q1iQMbSwWlmyniPf4VBH9cJwrF_TWNypipM,4659
255
- canvas-0.10.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
256
- canvas-0.10.1.dist-info/entry_points.txt,sha256=VSmSo1IZ3aEfL7enmLmlWSraS_IIkoXNVeyXzgRxFiY,46
257
- canvas-0.10.1.dist-info/RECORD,,
254
+ canvas-0.10.2.dist-info/METADATA,sha256=TxqKd5hBOrISD-YP51DGdtYw7Hz5y_JfBsUAyQ3WTr4,4659
255
+ canvas-0.10.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
256
+ canvas-0.10.2.dist-info/entry_points.txt,sha256=VSmSo1IZ3aEfL7enmLmlWSraS_IIkoXNVeyXzgRxFiY,46
257
+ canvas-0.10.2.dist-info/RECORD,,
@@ -40,14 +40,20 @@ def validate_package(package: Path) -> Path:
40
40
 
41
41
 
42
42
  def _build_package(package: Path) -> Path:
43
- """Runs `poetry build` on `package` and returns the built archive."""
43
+ """Runs `poetry build` on `package` and returns the built archive, ignoring symlinks, hidden folders, and hidden files."""
44
+ package = package.resolve()
45
+
44
46
  if not package.exists() or not package.is_dir():
45
47
  raise typer.BadParameter(f"Couldn't build {package}, not a dir")
46
48
 
47
49
  with tempfile.NamedTemporaryFile(suffix=".tar.gz", delete=False) as file:
48
50
  with tarfile.open(file.name, "w:gz") as tar:
49
- tar.add(package, arcname=".")
51
+ for root in package.rglob("*"):
52
+ # Skip hidden files and directories (starting with '.') and symlinks
53
+ if any(part.startswith(".") for part in root.parts) or root.is_symlink():
54
+ continue
50
55
 
56
+ tar.add(root, arcname=root.relative_to(package))
51
57
  return Path(file.name)
52
58
 
53
59
 
@@ -197,11 +203,12 @@ def install(
197
203
  if r.status_code == requests.codes.created:
198
204
  print(f"Plugin {plugin_name} successfully installed!")
199
205
 
200
- # If we got a bad_request, means there's a duplicate plugin and install can't handle that.
206
+ # If we got a conflict, means there's a duplicate plugin and install can't handle that.
201
207
  # So we need to get the plugin-name from the package and call `update` directly
202
- elif r.status_code == requests.codes.bad_request and (
208
+ elif r.status_code == requests.codes.conflict and (
203
209
  package_name := _get_name_from_metadata(host, token, built_package_path)
204
210
  ):
211
+ print(f"Plugin {package_name} already exists, updating instead...")
205
212
  update(package_name, built_package_path, is_enabled=True, host=host)
206
213
  else:
207
214
  print(f"Status code {r.status_code}: {r.text}")