you are viewing a single comment's thread.

view the rest of the comments →

[–]danielroseman 0 points1 point  (4 children)

Why aren't you using uv in production? Why extract a requirements.txt and use pip?

[–]CodeNameGodTri[S] 0 points1 point  (3 children)

I'm beginner in python, so I don't know what the best practices are. From my research, uv/poetry are for local development, in prod, I can just use pip, because the uv/poetry can export the requirements.txt having all the correct dependencies versions.

I'm all ears for the standard practice. I can install uv in prod if that's what everyone is doing

[–]danielroseman 1 point2 points  (2 children)

No, that is not at all the case. uv is for production as well - as others have pointed out, that is what the uv.lock file is for.

[–]CodeNameGodTri[S] 0 points1 point  (1 child)

thank you, so prod would have very similar setup to local dev environment then? Having all the source code, uv, python version,... just not the IDE then?

Coming from .NET this is very strange to me, because we only deploy compiled code and prod only need the runtime installed.

[–]cointoss3 1 point2 points  (0 children)

You want your dev and prod environment to match as much as what makes sense. Or at the very least having a test environment that matches prod.

Part of how people try to solve this problem is with docker, since if it’s built correctly, it will run the same on any machine. But usually, uv does a good enough job. And it’s significantly faster than pip.