How to use FastAPI with uv and src-layout? #255
Unanswered
brainbytes42
asked this question in
Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
First Check
Commit to Help
Example Code
Description
I generally use uv as package manager and build-tool und src-layout for better testability.
To run a simple module, I'd do
uv run -m foo.mainas shown above - note that the src-folder is not contained in the command, but uv handles the package-import.Now I try to use FastAPI-CLI in this setup, but I only get it to run with the full path including "src" - which suggests, the script will be run directly and not as an imported package - so the controlled environment usually provided by uv is ignored.
Is there any clean/canonical way to run fastapi-CLI with uv and src-layout?
Thanks!
Operating System
Windows
Operating System Details
Win 11
Python Version
3.14
Additional Context
No response
Beta Was this translation helpful? Give feedback.
All reactions