Python
Python, Django, FastAPI, Flask, ASGI, WSGI, and dependency-aware runtimes.
Detection
Python is detected from pyproject.toml, requirements.txt, manage.py, Python-oriented start commands, or a discovered Python main file. MkDocs is evaluated first and receives its own static-site provider.
Supported frameworks
Framework and server are detected independently. Anybuild supports the following Python frameworks and derives the appropriate ASGI or WSGI application import when applicable.
| Framework | Config value | Primary detection | Default runner |
|---|---|---|---|
| Django | django | django dependency with manage.py | Uvicorn |
| Streamlit | streamlit | streamlit dependency | Streamlit CLI |
| FastAPI | fastapi | fastapi dependency | Uvicorn |
| Flask | flask | flask dependency | Uvicorn |
| FastHTML | python-fasthtml | python-fasthtml dependency | Uvicorn |
| MCP | mcp | mcp or mcp[cli] dependency | MCP CLI or the application itself |
Set ANYBUILD_PYTHON_FRAMEWORK to the config value to override automatic detection.
Supported servers
Anybuild recognizes these application servers from project dependencies. When no server is declared, Django, FastAPI, Flask, and FastHTML default to Uvicorn.
| Server | Config value | Primary detection | Application type |
|---|---|---|---|
| Uvicorn | uvicorn | uvicorn dependency or framework default | ASGI or WSGI |
| Hypercorn | hypercorn | hypercorn dependency | ASGI |
| Daphne | daphne | daphne dependency | ASGI |
Set ANYBUILD_PYTHON_SERVER to the config value to override automatic detection.
Dependencies
Python installs are driven by uv and the discovered pyproject/requirements context. Referenced requirement and constraint files are included. Optional ffmpeg and pandoc dependencies become explicit plan packages when detected or configured.
Common configuration
| Variable | Purpose | Example value |
|---|---|---|
ANYBUILD_PYTHON_VERSION | Python package version; current default is 3.13. | 3.13 |
ANYBUILD_PYTHON_FRAMEWORK | Force a supported framework. | fastapi |
ANYBUILD_PYTHON_SERVER | Force a supported application server. | uvicorn |
ANYBUILD_ASGI_APPLICATION | Set the ASGI import path. | main:app |
ANYBUILD_WSGI_APPLICATION | Set the WSGI import path. | app:app |
ANYBUILD_PYTHON_PRECOMPILE | Control bytecode precompilation. | true |
ANYBUILD_PYTHON_EXTRA_DEPENDENCIES | JSON array of additional packages. | ["orjson"] |