uv icon indicating copy to clipboard operation
uv copied to clipboard

src directory is not used for --app and default Projects

Open denkasyanov opened this issue 1 year ago • 1 comments

uv 0.4.0 (d9bd3bc7a 2024-08-28)

After one of previous releases (I believe after 0.4.0) FastAPI docs on initailizing a project looks a little bit ouf of date https://docs.astral.sh/uv/guides/integration/fastapi/#initializing-a-fastapi-project

After some experimenting I noticed that initializing a project with one of the following two commands doesn't create src directory with uv 0.4.0.

uv init app (default) uv init --app app (App project)

Currently FastAPI integration docs linked above say

uv uses a src layout for newly-created projects

But it only seems to be true for commands like ``uv init --lib app` which doesn't look applicable.

Accordingly, the tree structure example /https://github.com/astral-sh/uv/blame/main/docs/guides/integration/fastapi.md#L100-L115

and the command https://github.com/astral-sh/uv/blame/main/docs/guides/integration/fastapi.md#L119-L121

seem to also need to be adjusted for the current uv init behaviour

Initially I tried to follow the FastAPI integration guide exclusively. When I couldn't make it work as described I tried to reference other parts of docs (uv init reference and Projects section). Although I didn't find any incositencies, it felt like the behavior around src directory could be documented a little bit more explicitly (for us uv newcomers), especially after adding --app and --lib.

I would like to create a PR for FastAPI integration docs, and optionally for clarifying directory structure behaviour.

denkasyanov avatar Aug 29 '24 22:08 denkasyanov

I'd definitely appreciate some fixes to the FastAPI docs — I gave them a quick pass in #6752 but it sounds like I missed some stuff.

zanieb avatar Aug 29 '24 22:08 zanieb