Skip to content

Commit

Permalink
move piccolo_admin to ROUTER_DEPENDENCIES
Browse files Browse the repository at this point in the history
We don't use it for `esmerald` so don't include it by default for all routers.
  • Loading branch information
dantownsend committed Dec 12, 2023
1 parent 985513c commit 3d9b881
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
12 changes: 10 additions & 2 deletions piccolo/apps/asgi/commands/new.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@

TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), "templates/app/")
SERVERS = ["uvicorn", "Hypercorn"]
ROUTERS = ["starlette", "fastapi", "blacksheep", "litestar", "esmerald"]
ADMIN_DEPENDENCIES = ["piccolo_admin>=1.0.0"]
ROUTER_DEPENDENCIES = {
"fastapi": ["fastapi>=0.100.0"],
"starlette": ["starlette", *ADMIN_DEPENDENCIES],
"fastapi": ["fastapi>=0.100.0", *ADMIN_DEPENDENCIES],
"blacksheep": ["blacksheep", *ADMIN_DEPENDENCIES],
"litestar": ["litestar", *ADMIN_DEPENDENCIES],
# We don't currently use Piccolo Admin with esmerald, due to dependency
# conflicts with FastAPI. We'll revisit this at some point in the future
# when newer versions of FastAPI are released (DT - 12th December 2023).
"esmerald": ["esmerald"],
}
ROUTERS = list(ROUTER_DEPENDENCIES.keys())


def print_instruction(message: str):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
{{ router_dependency }}
{% endfor -%}
{{ server }}
piccolo[postgres]
piccolo_admin
piccolo[postgres]>=1.0.0

0 comments on commit 3d9b881

Please sign in to comment.