ephaptic 0.2.5__tar.gz → 0.2.7__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 (24) hide show
  1. {ephaptic-0.2.5 → ephaptic-0.2.7}/PKG-INFO +1 -1
  2. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/cli/__main__.py +10 -2
  3. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/ephaptic.py +3 -0
  4. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic.egg-info/PKG-INFO +1 -1
  5. {ephaptic-0.2.5 → ephaptic-0.2.7}/pyproject.toml +1 -1
  6. {ephaptic-0.2.5 → ephaptic-0.2.7}/LICENSE +0 -0
  7. {ephaptic-0.2.5 → ephaptic-0.2.7}/README.md +0 -0
  8. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/__init__.py +0 -0
  9. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/adapters/__init__.py +0 -0
  10. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/adapters/fastapi_.py +0 -0
  11. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/adapters/quart_.py +0 -0
  12. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/cli/__init__.py +0 -0
  13. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/client/__init__.py +0 -0
  14. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/client/client.py +0 -0
  15. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/localproxy.py +0 -0
  16. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/transports/__init__.py +0 -0
  17. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/transports/fastapi_ws.py +0 -0
  18. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic/transports/websocket.py +0 -0
  19. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic.egg-info/SOURCES.txt +0 -0
  20. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic.egg-info/dependency_links.txt +0 -0
  21. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic.egg-info/entry_points.txt +0 -0
  22. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic.egg-info/requires.txt +0 -0
  23. {ephaptic-0.2.5 → ephaptic-0.2.7}/ephaptic.egg-info/top_level.txt +0 -0
  24. {ephaptic-0.2.5 → ephaptic-0.2.7}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ephaptic
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: The Python client/server package for ephaptic.
5
5
  Author-email: uukelele <robustrobot11@gmail.com>
6
6
  License: MIT License
@@ -95,10 +95,11 @@ def generate(
95
95
 
96
96
  method_schema = {
97
97
  "args": {},
98
- "return": None
98
+ "return": None,
99
+ "required": [],
99
100
  }
100
101
 
101
- for param_name in sig.parameters:
102
+ for param_name, param in sig.parameters.items():
102
103
  hint = hints.get(param_name, typing.Any)
103
104
  adapter = TypeAdapter(hint)
104
105
 
@@ -107,6 +108,13 @@ def generate(
107
108
  schema_output["definitions"],
108
109
  )
109
110
 
111
+ if param.default == inspect.Parameter.empty:
112
+ method_schema["required"].append(param_name)
113
+ else:
114
+ method_schema["args"][param_name]["default"] = str(param.default)
115
+
116
+
117
+
110
118
  return_hint = hints.get("return", typing.Any)
111
119
  if return_hint is not type(None):
112
120
  adapter = TypeAdapter(return_hint)
@@ -95,14 +95,17 @@ class EphapticTarget:
95
95
  return emitter
96
96
 
97
97
  def expose(func: Callable):
98
+ global _EXPOSED_FUNCTIONS
98
99
  _EXPOSED_FUNCTIONS[func.__name__] = func
99
100
  return func
100
101
 
101
102
  def identity_loader(func: Callable):
103
+ global _IDENTITY_LOADER
102
104
  _IDENTITY_LOADER = func
103
105
  return func
104
106
 
105
107
  def event(model: typing.Type[pydantic.BaseModel]):
108
+ global _EXPOSED_EVENTS
106
109
  _EXPOSED_EVENTS[model.__name__] = model
107
110
  return model
108
111
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ephaptic
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: The Python client/server package for ephaptic.
5
5
  Author-email: uukelele <robustrobot11@gmail.com>
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ephaptic"
7
- version = "0.2.5"
7
+ version = "0.2.7"
8
8
  authors = [
9
9
  { name="uukelele", email="robustrobot11@gmail.com" },
10
10
  ]
File without changes
File without changes
File without changes
File without changes