if name == "main":
print("starting")
asyncio.run(app.run())
**Environment**
Running Propan 0.1.5.23 with CPython 3.11.5 on Linux
**Additional context**
I know v1 is outdated but for now i can't switch to v2 since a lib we use is currently v1 only.
** Error Log**
The error i get (i replaced the absolute paths)
Traceback (most recent call last):
File "project_folder/.venv/lib/python3.11/site-packages/propan/cli/app.py", line 219, in run
await self._stop(log_level)
File "project_folder/.venv/lib/python3.11/site-packages/propan/cli/app.py", line 233, in _stop
await self._stop_event.wait()
File "project_folder/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 1621, in wait
await self._event.wait()
File "/usr/lib/python3.11/asyncio/locks.py", line 213, in wait
await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 7fc8dc79bed0
During handling of the above exception, another exception occurred:
Exception Group Traceback (most recent call last):
| File "project_folder/src/simple_demo.py", line 26, in
| asyncio.run(app.run())
| File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
| return runner.run(main)
| ^^^^^^^^^^^^^^^^
| File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
| return self._loop.run_until_complete(task)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
| return future.result()
| ^^^^^^^^^^^^^^^
| File "project_folder/.venv/lib/python3.11/site-packages/propan/cli/app.py", line 217, in run
| async with anyio.create_task_group() as tg:
| File "project_folder/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 664, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "project_folder/.venv/lib/python3.11/site-packages/propan/cli/app.py", line 228, in _start
| await self._startup()
| File "project_folder/.venv/lib/python3.11/site-packages/propan/cli/app.py", line 243, in _startup
| await self.broker.start()
| File "project_folder/.venv/lib/python3.11/site-packages/propan/brokers/rabbit/rabbit_broker.py", line 179, in start
| queue = await self._init_handler(handler)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "project_folder/.venv/lib/python3.11/site-packages/propan/brokers/rabbit/rabbit_broker.py", line 264, in _init_handler
| routing_key=handler.queue.routing,
| ^^^^^^^^^^^^^^^^^^^^^
| File "project_folder/.venv/lib/python3.11/site-packages/propan/brokers/rabbit/schemas.py", line 60, in routing
| return self.routing_key or self.name or None
| ^^^^^^^^^^^^^^^^
| AttributeError: 'RabbitQueue' object has no attribute 'routing_key'
+------------------------------------
Describe the bug When using PydanticV1 (i used 1.10.12) the
RabbitRouter
feature doesn't work with the@router.handle
decorator.To Reproduce
broker = RabbitBroker() router = RabbitRouter()
queue = RabbitQueue( name="job.single", routing_key="job.single", auto_delete=True, )
exchange = RabbitExchange(name="test")
@router.handle(queue=queue, exchange=exchange) async def handler(): print("handler")
broker.include_router(router) app = PropanApp(broker)
if name == "main": print("starting") asyncio.run(app.run())
Traceback (most recent call last): File "project_folder/.venv/lib/python3.11/site-packages/propan/cli/app.py", line 219, in run await self._stop(log_level) File "project_folder/.venv/lib/python3.11/site-packages/propan/cli/app.py", line 233, in _stop await self._stop_event.wait() File "project_folder/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 1621, in wait await self._event.wait() File "/usr/lib/python3.11/asyncio/locks.py", line 213, in wait await fut asyncio.exceptions.CancelledError: Cancelled by cancel scope 7fc8dc79bed0
During handling of the above exception, another exception occurred: