MENU

Fun & Interesting

My 2025 uv-based Python Project Layout for Production Apps

Hynek Schlawack 15,690 2 months ago
Video Not Working? Fix It Now

In 2025, all you need to take a #Python application from a simple script to production is: uv. But, how do you setup your project directory structure for success? How do take advantage of the latest development in Python packaging tooling like dependency groups? I'll walk you step-by-step to my proven project layout that we use for our vital production applications. We start with a simple FastAPI view and we end up with a nice local project that's fun to work on and that's easy to give to other people. 🔗 Links ► My employer, the best German-speaking web host and domain registrar: https://www.variomedia.de/ ► OrbStack: the MUCH better drop-in alternative to Docker Desktop: https://orbstack.dev/ ► uv: https://docs.astral.sh/uv/ ► https://www.youtube.com/watch?v=_FdjW47Au30 ► https://www.youtube.com/watch?v=8UuW8o4bHbw ► https://youtu.be/BxikFuvaT1Y ► FastAPI https://fastapi.tiangolo.com/ ► Testing & Packaging aka Why src? https://hynek.me/articles/testing-packaging/ ► Production-ready Python Docker Containers with uv: https://hynek.me/articles/docker-uv/ ► Me 360-noscoping PEP 751 https://discuss.python.org/t/pep-751-now-with-graphs/69721/86 🤓 ME ELSEWHERE 🏡: https://hynek.me/ 🐘: https://mastodon.social/@hynek/ 🦋: https://bsky.app/profile/hynek.me 🅇: https://twitter.com/hynek 🧵: https://www.threads.net/@the_hynek ✉️ Newsletter: https://buttondown.email/hynek ❤️ Support my work: https://hynek.me/say-thanks/ 🙏 CREDITS Outro Music: https://www.youtube.com/channel/UCNX0p--V0RBAZqsOxdMhAyw / https://rplktr.com/ Other music and material licensed from Envato. 📖 Chapters 0:00:00 Is this video for you? 0:00:54 Who am I? 0:01:26 The goal of THIS video 0:03:26 uv in under 60s 0:05:00 The App 0:09:00 Scenic detour: Entrypoints 0:13:02 Configuration 0:15:35 brief meltdown 0:15:53 Dependency groups 0:17:41 Build backend 0:18:27 RUN! 0:21:04 What have we achieved? 0:21:23 Up next! 0:21:41 Thank you & goodbye! ❤️

Comment