canvas 0.29.0__py3-none-any.whl → 0.29.1__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.4
2
2
  Name: canvas
3
- Version: 0.29.0
3
+ Version: 0.29.1
4
4
  Summary: SDK to customize event-driven actions in your Canvas instance
5
5
  Author-email: Canvas Team <engineering@canvasmedical.com>
6
6
  License-Expression: MIT
@@ -195,7 +195,7 @@ canvas_sdk/handlers/application.py,sha256=6Y18g65ae1ws7-llyKzyWipOg9Y8zVEoV7Y_0E
195
195
  canvas_sdk/handlers/base.py,sha256=CpUIDtnZJCJTHytXuz_x43NU8Zy1ejorqfGf0e2H2oY,1422
196
196
  canvas_sdk/handlers/cron_task.py,sha256=zShv4qGUmpUjG3HrXVqzMir9kZyqo4nDT3ETqNP13sk,954
197
197
  canvas_sdk/handlers/simple_api/__init__.py,sha256=4_GLVafEsgdIBGyxJ6lpl2V0d--MHPsBQrdOeun7o98,431
198
- canvas_sdk/handlers/simple_api/api.py,sha256=-HYep9FKR9vEqm1eSPq7ukUO5eefoeqqQA3wo6uBsmA,19868
198
+ canvas_sdk/handlers/simple_api/api.py,sha256=5xEZCw54-RM4kRwhXRVlNtA5fALckJtqAi6PH-rdqT0,19876
199
199
  canvas_sdk/handlers/simple_api/exceptions.py,sha256=qSm_TnN3fdHZf5wz8BS3ueWpjyCDDY2yik0wx2HhGrc,1245
200
200
  canvas_sdk/handlers/simple_api/security.py,sha256=_jWcJv9xTIeCz8B5vYPm3U8rwhDmFtjSaa5jKpM4VQw,5601
201
201
  canvas_sdk/handlers/simple_api/tools.py,sha256=o5Dtwj2i7A-W7owxqhl1Yn8tBtnKB_fsJ9aMiouNYeU,3961
@@ -213,7 +213,7 @@ canvas_sdk/templates/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
213
213
  canvas_sdk/templates/tests/test_utils.py,sha256=VRahmmVwXKcp1NMLoA3BZL4cFFXzFnD-i5IUpcEeXTg,1832
214
214
  canvas_sdk/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
215
215
  canvas_sdk/tests/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
216
- canvas_sdk/tests/handlers/test_simple_api.py,sha256=v4A131xjJsgzmrmRuMtsSTBZw8ZIdJqex11CgfFk-hk,84084
216
+ canvas_sdk/tests/handlers/test_simple_api.py,sha256=PQLZwQBSPpFH9b2Swgx3zeoTnAcHyDVDuz1cyDrgi18,84324
217
217
  canvas_sdk/utils/__init__.py,sha256=nZEfYeU-qNZBOh39b8zAuEh0Wzh2PgXxs0NRKKe66Pg,184
218
218
  canvas_sdk/utils/http.py,sha256=LB0njXF5evJymXMfaHCwxa6dlJKdYfBCFJSLvcnIQ20,8029
219
219
  canvas_sdk/utils/plugins.py,sha256=853MW2fiLpyG3o9ISEawAthQeRiZP73cai5Tngwu4MY,767
@@ -281,7 +281,7 @@ plugin_runner/authentication.py,sha256=UyyhXajokVFH866dpDhoTlXS9Cg7y0sQltn0_LcwX
281
281
  plugin_runner/aws_headers.py,sha256=DenX_nAMVhXMJZw88PLZbqJsi5_XriNtr3jE-eJqHY4,2773
282
282
  plugin_runner/exceptions.py,sha256=YnRZiQVzbU3HrVlmEXLje_np99009YnhTRVHHyBCtqc,433
283
283
  plugin_runner/installation.py,sha256=-TntCAveju5vWrKRLnIxy9xn3pnU3goo5dT4tGs-85s,7537
284
- plugin_runner/plugin_runner.py,sha256=O0rfs8cnoG-Ni7-AlVYTcStEu5wgWoAzWvtJKqPRaYI,19680
284
+ plugin_runner/plugin_runner.py,sha256=CIgomNpCXqEXoY4qV2rPl3pkQ-96efNXkq5ne1nRmMw,19915
285
285
  plugin_runner/sandbox.py,sha256=Y-idLdjjt0i45tlhKDqCA34WgXe4gLDfc3QdEpxW0Ls,14548
286
286
  plugin_runner/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
287
287
  plugin_runner/tests/test_application.py,sha256=e1R2YagMRD96gZALx-Zra-e-sR3SiP7cIpI6pheZnUc,2427
@@ -358,7 +358,7 @@ protobufs/canvas_generated/messages/plugins.proto,sha256=oNainUPWFYQjgCX7bJEPI9_
358
358
  protobufs/canvas_generated/services/plugin_runner.proto,sha256=doadBKn5k4xAtOgR-q_pEvW4yzxpUaHNOowMG6CL5GY,304
359
359
  pubsub/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
360
360
  pubsub/pubsub.py,sha256=pyTW0JU8mtaqiAV6g6xjZwel1CVy2EonPMU-_vkmhUM,1044
361
- canvas-0.29.0.dist-info/METADATA,sha256=R5_6vIXwPjpbZGZsWMqs7q8k3t13EF7txQfHSDI-P18,4375
362
- canvas-0.29.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
363
- canvas-0.29.0.dist-info/entry_points.txt,sha256=0Vs_9GmTVUNniH6eDBlRPgofmADMV4BES6Ao26M4AbM,47
364
- canvas-0.29.0.dist-info/RECORD,,
361
+ canvas-0.29.1.dist-info/METADATA,sha256=btAtREswURUt0soOc28Mrx7xoonZ2qxdVmxq6-mTx1g,4375
362
+ canvas-0.29.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
363
+ canvas-0.29.1.dist-info/entry_points.txt,sha256=0Vs_9GmTVUNniH6eDBlRPgofmADMV4BES6Ao26M4AbM,47
364
+ canvas-0.29.1.dist-info/RECORD,,
@@ -162,7 +162,7 @@ class Request:
162
162
  self._body = event.context["body"]
163
163
  self.headers = CaseInsensitiveMultiDict(separate_headers(event.context["headers"]))
164
164
 
165
- match = path_pattern.match(event.context["path"])
165
+ match = path_pattern.fullmatch(event.context["path"])
166
166
  self.path_params = match.groupdict() if match else {}
167
167
 
168
168
  self.query_params = MultiDict(parse_qsl(self.query_string))
@@ -296,7 +296,7 @@ class SimpleAPIBase(BaseHandler, ABC):
296
296
  self._path_pattern = None
297
297
  self._handler = None
298
298
  for path_pattern, handler in self._ROUTES.get(self.event.context["method"], ()):
299
- if path_pattern.match(self.event.context["path"]):
299
+ if path_pattern.fullmatch(self.event.context["path"]):
300
300
  self._path_pattern = path_pattern
301
301
  self._handler = handler
302
302
  break
@@ -514,12 +514,19 @@ def test_request_routing_path_pattern(
514
514
  ("/path/<value>", "/path/test", "/prefix/path/test", {"handler_method": "first"}),
515
515
  ("/path/test", "/path/<value>", "/prefix/path/test", {"handler_method": "first"}),
516
516
  ("/path/test", "/path/<value>", "/prefix/path/value", {"handler_method": "second"}),
517
+ (
518
+ "/path/<value>",
519
+ "/path/<value>/test",
520
+ "/prefix/path/value/test",
521
+ {"handler_method": "second"},
522
+ ),
517
523
  ],
518
524
  ids=[
519
525
  "pattern registered first, path matches only pattern",
520
526
  "pattern registered first, path matches both pattern and fixed",
521
527
  "fixed registered first, path matches both pattern and fixed",
522
528
  "fixed registered first, path matches only pattern",
529
+ "two patterns share the same first two segments and then diverge",
523
530
  ],
524
531
  )
525
532
  def test_request_routing_path_pattern_multiple_matches(
@@ -555,7 +555,10 @@ async def serve(specified_plugin_paths: list[str] | None = None) -> None:
555
555
 
556
556
  log.info(f"Starting server, listening on port {port}")
557
557
 
558
- install_plugins()
558
+ # Only install plugins if the plugin runner was not started from the CLI
559
+ if specified_plugin_paths is None:
560
+ install_plugins()
561
+
559
562
  load_plugins(specified_plugin_paths)
560
563
 
561
564
  await server.start()
@@ -577,12 +580,13 @@ def run_server(specified_plugin_paths: list[str] | None = None) -> None:
577
580
  asyncio.set_event_loop(loop)
578
581
 
579
582
  try:
580
- loop.run_until_complete(
581
- asyncio.gather(
582
- serve(specified_plugin_paths),
583
- synchronize_plugins_and_report_errors(),
584
- )
585
- )
583
+ coros = [serve(specified_plugin_paths)]
584
+
585
+ # Only start the synchronizer if the plugin runner was not started from the CLI
586
+ if specified_plugin_paths is None:
587
+ coros.append(synchronize_plugins_and_report_errors())
588
+
589
+ loop.run_until_complete(asyncio.gather(*coros))
586
590
  except KeyboardInterrupt:
587
591
  pass
588
592
  finally: