astral-sh/rye

Cannot call an async function with rye run

haplo opened this issue · 0 comments

Steps to Reproduce

  1. rye init async_call
  2. cd async_call
  3. echo -e 'async def hello():\n print("Hi!")' > src/async_call/main.py
  4. echo -e '[tool.rye.scripts]\nhello = { call = "src.async_call.main:hello" }' >> pyproject.toml
  5. rye run hello

Expected Result

$ rye run hello
Hi!

Actual Result

$ rye run hello
<coroutine object hello at 0x7c7ac106cac0>
sys:1: RuntimeWarning: coroutine 'hello' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Version Info

rye 0.39.0
commit: 0.39.0 (bf3ccf818 2024-08-21)
platform: linux (x86_64)
self-python: cpython@3.12.5
symlink support: true
uv enabled: true

Stacktrace

No response