How to Run Python in Production
ashishb.net
ashishb.net
additional: "However, writing your own code that involves async functions", your code does use async functions, its just monkey patched into your program because you used green threads instead.
You can use poetry instead. Poetry is stable.
I wish `uv` was version 1.0 or later. However, despite it not being version 1.0 yet, I do see that it provides a superior experience for me to switch from `poetry` to `uv` and to make that recommendation after adding the pre-version 1.0 caveat.
I see the entire community gravitating towards uv because of its merits. I tried it, and I agree. I already started using it for every project. I’ve even converted older projects to it.
This is from their own documentation and release history. I never brought up version numbers before now, only their self-admitted unstable status. Version numbers were brought up by someone of the opinion that uv is stable enough.
Yeah, that's how it is because it is costly for maintainers to maintain. What's your point though, is poetry better in this regard or what are you suggesting as a better alternative to uv?
pip has the same problem as uv in this regard, but I'd be hoping that there would be less breaking from breaking changes, due to the amount of people depending on pip not breaking.
If I had money? I'd fork pip or uv and assign some people to make an downstream with extended support.
It’s not feasible for everyone to do a full evaluation of everything. At some point you need to rely on an expert to at least provide some basic assurances before spending time on digging deeper.
There docs around GitHub Actions and docker are also pretty succinct and usable.
Can you share a scenario where this would happen?
I have deployed multiple machine learning and data analytics-focused web services, and this has never happened to me.
Blocking python can’t.
An example is running multiprocesses and parsing their output and looking for patterns. Async python does this sort of thing well.
FastAPI is faster than the other popular framework, Flask (I posted data supporting that), even without using async.
I only suggested that one should use their discretion when using async.
When did I suggest not to write async code?
However, ruff keeps evolving rapidly, so I am hopeful that I can get rid of all other linters and formatters over time. If you have a suggestion on streamlining my `make format` and `make lint` commands, I am all ears.
Presenting these opinions as truths will get the hackles up of those who have a different opinion.
Isn't that always implicit?
But for certain use-cases, as mentioned in the article itself, it is unavoidable.
Further, you might be working at a company that has decided to use Python, and you can make Python more efficient and effective using these suggestions.
A lot of the world runs just find on Python (see Django), async is mature and stable.
I never claimed that one should not use `async`, I am only suggesting that be careful about using `async`.
In my experience, a median Go programmer is more comfortable with Go routines than a median Python programmer is with async functions. YMMV.