setup.py–based dependency logic causes issues with pyproject.toml workflows
Is there an existing issue for this?
Is your feature request related to a problem? Please describe.
I ran into this while trying to work with Sanic in a setup that’s fully based on pyproject.toml. Sanic currently relies on setup.py to ensure that uvloop and ujson are installed by default, since they significantly improve performance, while still allowing them to be disabled for a pure-Python setup.
The issue is that this approach doesn’t play well with newer tooling and workflows. In my case, tools like uv sync expect the build to be driven by pyproject.toml, and the custom setup.py logic and environment variables make this harder to work with. The extras system also doesn’t quite fit this use case unless Sanic switches to something like FastAPI’s fastapi[standard] install pattern.
Describe the solution you'd like
A simple solution would be to have the main sanic package depend on these optional libraries by default. This would make installs smoother in modern setups, while still allowing users to disable their usage at runtime or skip them on platforms where they’re not available.
Other options could be maintaining a separate sanic-minimal package or asking users to install something like sanic[standard], similar to FastAPI. Both of these feel a bit clunky, especially for existing users.
From my experience, making the default package depend on these libraries seems like the cleanest way forward, particularly as relying on legacy setup.py behavior is becoming increasingly painful.
Additional context
None
Source: sanic-org/sanic