ephaptic 0.2.6__py3-none-any.whl → 0.2.8__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.
ephaptic/cli/__main__.py CHANGED
@@ -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)
ephaptic/ephaptic.py CHANGED
@@ -1,5 +1,5 @@
1
1
  import asyncio
2
- from warnings import deprecated
2
+ import warnings
3
3
  import msgpack
4
4
  import redis.asyncio as redis
5
5
  import pydantic
@@ -172,7 +172,12 @@ class Ephaptic:
172
172
  return EphapticTarget(targets)
173
173
 
174
174
  def __getattr__(self, name: str):
175
- @deprecated("Use `emit` and the new (typed) event system instead.")
175
+ warnings.warn(
176
+ "Use `emit` and the new (typed) event system instead.",
177
+ DeprecationWarning,
178
+ stacklevel=2,
179
+ )
180
+ # @deprecated("")
176
181
  async def emitter(*args, **kwargs):
177
182
  transport: Transport = _active_transport_ctx.get()
178
183
  if not transport:
@@ -309,4 +314,4 @@ class Ephaptic:
309
314
  import traceback
310
315
  traceback.print_exc()
311
316
  finally:
312
- if current_uid: manager.remove(current_uid, transport)
317
+ if current_uid: manager.remove(current_uid, transport)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ephaptic
3
- Version: 0.2.6
3
+ Version: 0.2.8
4
4
  Summary: The Python client/server package for ephaptic.
5
5
  Author-email: uukelele <robustrobot11@gmail.com>
6
6
  License: MIT License
@@ -1,19 +1,19 @@
1
1
  ephaptic/__init__.py,sha256=QIEfepOHMtM6Lrxg4AwZ28gEj0D5TY2UP8MGlrAb-DI,137
2
- ephaptic/ephaptic.py,sha256=2Yd1gXrzXWjUiMm0yubt84JUC4PesUrRWnql_rbbfTU,11989
2
+ ephaptic/ephaptic.py,sha256=UPHifK3qDSlwKmt1SmuGwvpjGPUNLdJm758IAPEKaZg,12083
3
3
  ephaptic/localproxy.py,sha256=fJaaskkiD6C2zaOod0F0HNWIbdKs_JMuHFwd0-sdLIM,19477
4
4
  ephaptic/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  ephaptic/adapters/fastapi_.py,sha256=yfSbJuA7Tgeh9EhZkfIve0Uj-cOZmTBljlBsCRKh2EE,1007
6
6
  ephaptic/adapters/quart_.py,sha256=MBo9g6h_zI63mL4aGdrvV5yEXsHaOd0Iv5J8SAPHBoA,537
7
7
  ephaptic/cli/__init__.py,sha256=p_mYumuQLr3HZa-6I4QKut6khZv3WQjEX-B-aa4cdEE,44
8
- ephaptic/cli/__main__.py,sha256=jBFS6l6xJ1skKlvkw37n3oaCUMmvhKjn1yKMTWazc5g,4589
8
+ ephaptic/cli/__main__.py,sha256=MNzOfPK4DMwlnplJzT3NWBJdMnR0UFgcDl_8VvwO_QA,4866
9
9
  ephaptic/client/__init__.py,sha256=NeaPIzTFeozP54wlDYHIg_adHP3Z3LWVujsRUlpn4_U,35
10
10
  ephaptic/client/client.py,sha256=YYAlzA40xBvWsiDu0Gsd1EBJaqivLR-bSszepWdNODs,4181
11
11
  ephaptic/transports/__init__.py,sha256=kSAlgvm8sV9nHHu61LTjjTpv4bweah90xvFrwQMDQtQ,169
12
12
  ephaptic/transports/fastapi_ws.py,sha256=X0PMRcwM-KDpKA-zXShGTFhD1kHMSqrx3PBBKZtQ1W0,258
13
13
  ephaptic/transports/websocket.py,sha256=jwgclSDSq0lQCvgwjwUXe9MzPk7NH0FdmsLhWxYBh-4,261
14
- ephaptic-0.2.6.dist-info/licenses/LICENSE,sha256=kMpJjLKMj6zsAhf4uHApO4q0r31Ye1VyfBOl9cFW13M,1065
15
- ephaptic-0.2.6.dist-info/METADATA,sha256=s7vEc7TfL7wjn4geyzgkpqtYLxh4hG0Bryemfqgmu7M,8533
16
- ephaptic-0.2.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
17
- ephaptic-0.2.6.dist-info/entry_points.txt,sha256=lis9vIDIrMVJM43r9ooFkb07KhrX4946duvYru3VfT4,46
18
- ephaptic-0.2.6.dist-info/top_level.txt,sha256=nNhdhcz2o_IuwZ9I2uWQuLZrRmSW0dQVU3qwGrb35Io,9
19
- ephaptic-0.2.6.dist-info/RECORD,,
14
+ ephaptic-0.2.8.dist-info/licenses/LICENSE,sha256=kMpJjLKMj6zsAhf4uHApO4q0r31Ye1VyfBOl9cFW13M,1065
15
+ ephaptic-0.2.8.dist-info/METADATA,sha256=dzajbn6TXAfbzCgRIzo7CED8OPWaALxtUqH1vEpxAE0,8533
16
+ ephaptic-0.2.8.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
17
+ ephaptic-0.2.8.dist-info/entry_points.txt,sha256=lis9vIDIrMVJM43r9ooFkb07KhrX4946duvYru3VfT4,46
18
+ ephaptic-0.2.8.dist-info/top_level.txt,sha256=nNhdhcz2o_IuwZ9I2uWQuLZrRmSW0dQVU3qwGrb35Io,9
19
+ ephaptic-0.2.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5