oocana-python-executor 0.16.15__tar.gz → 0.16.17__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 (20) hide show
  1. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/PKG-INFO +1 -1
  2. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/pyproject.toml +1 -1
  3. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/credential.py +2 -5
  4. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/matplot/oomol_matplot_helper.py +2 -2
  5. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/tests/test_credential.py +9 -3
  6. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/__init__.py +0 -0
  7. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/block.py +0 -0
  8. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/context.py +0 -0
  9. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/data.py +0 -0
  10. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/executor.py +0 -0
  11. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/hook.py +0 -0
  12. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/logger.py +0 -0
  13. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/matplot/matplotlib_oomol/__init__.py +0 -0
  14. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/matplot/matplotlib_oomol/oomol.py +0 -0
  15. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/secret.py +0 -0
  16. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/service.py +0 -0
  17. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/topic.py +0 -0
  18. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/python_executor/utils.py +0 -0
  19. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/tests/test_cli.py +0 -0
  20. {oocana_python_executor-0.16.15 → oocana_python_executor-0.16.17}/tests/test_secret.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oocana-python-executor
3
- Version: 0.16.15
3
+ Version: 0.16.17
4
4
  Summary: a client subscribe mqtt topic to execute oocana's block
5
5
  Author-Email: l1shen <lishen1635@gmail.com>, yleaf <11785335+leavesster@users.noreply.github.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "oocana-python-executor"
3
- version = "0.16.15"
3
+ version = "0.16.17"
4
4
  authors = [
5
5
  { name = "l1shen", email = "lishen1635@gmail.com" },
6
6
  { name = "yleaf", email = "11785335+leavesster@users.noreply.github.com" },
@@ -1,9 +1,6 @@
1
1
  from typing import Any, Dict
2
- from oocana import InputHandleDef
3
- class CredentialInput:
4
- def __init__(self, type: str, id: str):
5
- self.type = type
6
- self.id = id
2
+ from oocana import InputHandleDef, CredentialInput
3
+
7
4
 
8
5
  def generate_credential_input(credential_path: str) -> CredentialInput | None:
9
6
  """Generate a CredentialInput from a credential path string.
@@ -64,7 +64,7 @@ def setup_plotly(logger: Logger):
64
64
  color_scheme = os.getenv("OOMOL_COLOR_SCHEME", "dark")
65
65
  # The generated html has default body margin 8px in chrome, remove it.
66
66
  html = re.sub(r'<html[^>]*?>', r'\g<0><style>html { color-scheme: ' + color_scheme + '; height: 100%; align-content: center } ' +
67
- 'body { overflow: hidden; margin: 0 }</style>', html, flags=re.I)
67
+ 'body { margin: 0 }</style>', html, flags=re.I)
68
68
  context.preview({ "type": "html", "data": html })
69
69
  else:
70
70
  logger.warning('plotly: no sys.modules["oomol"]')
@@ -77,4 +77,4 @@ def setup_plotly(logger: Logger):
77
77
 
78
78
  def import_helper(logger: Logger):
79
79
  setup_matplot(logger)
80
- setup_plotly(logger)
80
+ setup_plotly(logger)
@@ -26,9 +26,7 @@ class TestCredential(unittest.TestCase):
26
26
  v = replace_credential({
27
27
  "c": f'${{{{OO_CREDENTIAL:{ORIGIN_VALUE}}}}}'
28
28
  }, {
29
- "c": InputHandleDef(handle="c", json_schema={
30
- "contentMediaType": "oomol/credential"
31
- }, value=None)
29
+ "c": InputHandleDef(**{"handle": "c", "json_schema": {"contentMediaType": "oomol/credential"}})
32
30
  })
33
31
  cred_input = v.get("c")
34
32
  self.assertIsInstance(cred_input, CredentialInput)
@@ -54,6 +52,14 @@ class TestCredential(unittest.TestCase):
54
52
 
55
53
  # 'a' should remain unchanged since no input_def for it
56
54
  self.assertEqual(cred_input_a, f'${{{{OO_CREDENTIAL:{ORIGIN_VALUE}}}}}')
55
+
56
+ def test_credential_no_handle_def(self):
57
+ """Test credential replacement when no handle definition is provided"""
58
+ v = replace_credential({
59
+ "c": f'${{{{OO_CREDENTIAL:{ORIGIN_VALUE}}}}}'
60
+ }, None)
61
+ # Should remain unchanged because no input_def is provided
62
+ self.assertEqual(v.get("c"), f'${{{{OO_CREDENTIAL:{ORIGIN_VALUE}}}}}')
57
63
 
58
64
  def test_credential_in_other_string(self):
59
65
  """Test credential pattern inside other string (should not be replaced)"""