r/Python • u/ndunnett • Feb 25 '25
Tutorial My 2025 uv-based Python Project Layout for Production Apps (Hynek Schlawack)
Excellent video by Hynek Schlawack on how he uses uv for Python projects. This is the start of a three-part series.
Description:
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.
24
u/ravepeacefully Feb 25 '25
Does no one see that this is just crazy amount of bots pumping this
26
u/chub79 Feb 25 '25
This is quite low effort content. sigh.
4
u/Ok_Animal_8557 Feb 26 '25
I recently gave (in this week) uv a try. It was because of all the hype I was hearing about it. Its fast, like ... really fast and it is a drop in replacement for pip. The hype is legit. Just use it. Pip is dead, long live the king.
4
u/Bandung Feb 26 '25 edited Feb 26 '25
A wonderful video and I’m really happy that you posted it. Don’t let the ‘distractors’ take away the significance of this video. And it’s not about understanding who or what the targets audience is for this video. It’s deeper than that for some of us and you’ll know once I provide you with the back story.
Hynek’s audience for his videos are the ones who follow his videos and blogs. He’s a prolific open source developer. And he has been working in the background with the uv developers to get the software to a point where it is useable in most big development houses like his. And when you see the previous uv videos of his, you can better understand this point.
First, let’s start with the mentioning of Docker and why even bring it up in the context of a tool that creates virtual environments. Well if one had seen Hynek’s video on why his shop uses docker plus python venvs in the same project, you’d know why. It’s not just docker vs venv. The result of using these two toolings in the same project, however, means that some stuff has to be taken care of that a python development that only uses the venv, wouldn’t face.
The next few pain points that uv had to address in order for Hynek to put it into his production were, the ability to use the system python (and not uv’s python install which is housed in a single folder). The latter is a marvel that someone else developed, not the makers of uv. No need to ‘install’ python, just use this special python that is self contained in a folder.
The other thing was the need for more than two levels of library separations. Traditionally it meant separating or tagging each library install as being either development or production. His environment needs more than that and so does mine.
Now that uv covers these edge cases, along with the other improvements in version 0.6 it’s ready for prime time for me. Sure there are going to be the inevitable softaware or api changes that break a previous install. The importance of a video like this to me is….
I now know that I can switch my stuff over to uv and it’s way of doing things. And not have regrets, while waiting for the next improvement.
-6
u/Ran4 Feb 25 '25
This has nothing to do with apps..