Hynek Schlawack
Everything, newest first — across every channel. Their profile → · Subscribe
Hiding
20 November
15 November
14 November
13 November
4 November
2 November
1 November
28 October
22 October
21 October
19 October
17 October
11 October
1 October
29 September
26 September
25 September
16 September
6 September
4 September
2 September
20 August
30 July
26 July
13 July
2 July
24 June
9 June
6 June
5 June
6 July 2025
From one piece uv: Making Local Python Workflows FAST and BORING in 2025 20 beliefs, in the piece's order there
-
Their words
And the Philippines are probably the friendliest place on earth and incredible fun, especially on the less frequented islands.
-
Their words
Curiously, one of the most interesting compliments I got was that my conference speaking noticeably improved through my YouTubing, which is not something I expected to happen. But I guess agonizing over creating compelling educational material all year around helps creating other compelling educational material.
-
Their words
Being able to do this unconditionally is what Charlie Marsh means when he says that uv being categorically faster is enabling completely new workflows. This is one of them.
+ 17 more
-
korrents.com
Your shell can and should be fish.Their words
It will look at how the envrc script changes the environment variables and then apply those changes back into your current shell which totally can and should be fish.
-
korrents.com
Forcing a whole team to run code only through uv run might go too far and cause resistance.Their words
people tend to get grumpy and defensive when you force new things on them. No matter how many serious problems it solves, replacing the plumbing can raise some grumbles but should be fine overall. But also forcing everyone to only run the code using uv run... This might be one bridge too far that could cause resistance.
-
korrents.com
uv run solves the problem of a local virtualenv falling out of date after pulling a co-worker's lock-file changes.Their words
This means that the frequent gotcha of Git pulling some changes and your co-worker updated a bunch of dependencies in a lock file and your local virtualenv still has the old ones. It's solved forever.
-
Their words
Of course, just randomly reading dot env files before executing would be a security risk.
-
korrents.com
Overmind is much nicer than docker-compose for running multiple local processes at once.Their words
But if you sometimes need to run multiple processes at once, like a web app and a worker, do check it out. It's much nicer to use than docker-compose
-
Their words
I used to use tox for this, even though that it's not necessarily what it's been made for, but it's a great way to deterministically run commands in a Python environment. But with uv, I don't need that anymore for applications, since I have a just file anyway.
-
korrents.com
Starting custom commands and aliases with a comma is a useful way to list only your own commands with tab completion.Their words
But also consider starting your commands and aliases with a comma, such that comma tab presents you with a nice list of only your custom commands.
-
Their words
And you too shouldn't be afraid to create aliases for commands you use a lot. It's your shell, make it serve you.
-
Their words
So after literally decades of making do with make, and after years of living with a great alternative, I'm here to say just use just instead.
-
Their words
Make, as the name indicates, is for building things, usually software, and not running arbitrary commands. Which means that it is lacking affordances that you like to have, like easily passing arguments to a target, and that you occasionally have to fight make's instincts.
-
korrents.com
Contrary to common claims, makefiles are not standardized, since GNU and BSD make differ greatly.Their words
Secondly, and contrary to common claims, they are very much not standardized. For example, there's a huge difference between GNU and BSD makes.
-
korrents.com
Generative AI coding agents are more effective when given a quick way to get feedback on their own changes.Their words
it's kind of experiencing a renaissance with generative AI coding agents that are much more effective at their hallucinations if you give them a quick way to obtain feedback to their own changes.
-
Their words
I still recommend everyone to use the -m form whenever possible, both with uv run and python itself. It just removes another moving part that can go wrong and despite uv, there's still plenty of moving parts left that can break.
-
korrents.com
pdbpp is the best Python debugger module.Their words
Like the objectively best debugger module called pdbpp that has just found new maintainership and works on new python versions again, which makes me incredibly happy.
-
Their words
You can have an endless argument over what debugger is best, or you can accept that these development helpers a) are a matter of taste
-
Their words
it isolates you from security updates once they're only available on a major version bump in semantic versioning and it completely falls on its face with calendar-based versioning that is much more common than you may think.
-
korrents.com
uv's bottom pinning simplifies dependency resolution by limiting the number of eligible versions.Their words
On the other side, bottom pinning as employed by uv simplifies the resolution process by limiting the amount of eligible versions while resolving them.
27 February 2025
24 February 2025
From one piece My 2025 uv-based Python Project Layout for Production Apps 19 beliefs, in the piece's order there
-
Their words
I name my pytest fixture functions with an underscore and set their name explicitly to avoid the confusing error of forgetting to declare dependency in a test and accidentally using the function object as the fixture.
-
korrents.com
Unless told to do things in non-standard ways, uv leaves almost no room for user error.Their words
And unless you've explicitly told uv to do things in non-standard ways, there's almost no room for error from your side. It's essentially foolproof, which is my favorite kind of proof.
-
Their words
complaining on open source projects about changes breaking your production is very bad karma and shows that you don't have your dependencies under control?
+ 16 more
-
korrents.com
Dependency groups help package maintainers whose development extras otherwise leak into PyPI metadata.Their words
Therefore this is great for package maintainers that are annoyed that it looks like our packages depend on pytest or sphinx because their development extras leak into PyPI.
-
Their words
since this is an application that is eventually shipped to a server we don't care about package versions and we can set it to zero and never touch it again.
-
Their words
And this is the only module where you have my blessing to add it to coverage's `omit` list. And to mitigate the risk this introduces I keep them as simple as possible with no loops or if statements
-
Their words
I'm not a fan of like randomly groping into packages. I like to have clear standardized entry points into my applications whose only job is to bridge between the dirty real world and my pristine application.
-
Their words
Boundaries between systems are extremely important to contain complexity. Entry points allow you to interact with such a system across boundaries in a controlled way. The narrower and better defined an entry point the easier it is to reason about the interactions with the system and the better the containment of the complexity.
-
Their words
Simple but it happens to give us 100% test coverage which happens to be the only correct test coverage.
-
Their words
to make sure that when I run tests against the package the tests imports only pick up code that is part of the package and guaranteed to be installed and not imported accidentally because they're laying around. This catches a whole category of packaging and installation bugs
-
Their words
and are just doing whatever they're always done or whatever they see around the internet. I don't know I think in the age of UV it's time to reconsider.
-
Their words
But I honestly think that the prevalence of adhoc design in the Python ecosystem is just that Python's packaging tooling used to be a trash fire around 2010 – the formative years – and people did anything necessary to avoid interacting with it
-
Their words
There is no shame in going adhoc. The current implementation of PyPI which is called warehouse uses that layout. But I'm gonna be a model Python citizen and show you how to do it properly because it tightens the envelope of possible states and shapes that my project can be in which simplifies import logic greatly.
-
Their words
Personally I find pseudo-objective or unbiased content where people talk in theoretical terms about things they've never used themselves in anger rather unhelpful and I prefer contextualized earned opinions.
-
korrents.com
If you ship Python applications in Docker containers without special Conda features, uv is the only tool you need.Their words
As for Astral's ambition, if you already ship Python applications in Docker containers and got your way doing that without some special Conda features it is the only tool you need.
-
Their words
It appeared pretty much exactly a year ago in February of 2024 and for many people it already has lived up to the ambition. In some ways it has even surpassed its role models.
-
korrents.com
Using Docker locally for development is a terrible experience compared with today's local tooling.Their words
What I won't talk ever about is using Docker locally for development because it's such a terrible development experience compared to what's possible with local tooling nowadays.
-
korrents.com
Shipping Python applications in Docker containers quickly with safe, reproducible builds is a solved problem in 2025.Their words
Because local workflows can be ergonomic and robust now. Yes, really, with Python. And shipping Python applications using Docker containers really fast with safe, reproducible builds is a solved problem in 2025.
-
Their words
the good news is that over the run of 2024, Python's packaging and project tooling got infinitely better and faster.
21 December 2024
18 December 2024
17 December 2024
16 December 2024
9 December 2024
From one piece Master Flaky Systems With Retries in Python 🐍 (avoid self-DDoS) 20 beliefs, in the piece's order there
-
korrents.com
Chasing SEO and zeitgeist topics for a YouTube channel is something to emphatically avoid.Their words
unless I listen to the siren's call of SEO and serve zeitgeist topics everyone is searching for, which is something I emphatically do not want to do.
-
korrents.com
A sudden rise in retries from one or more systems is a sign that something is off and should be investigated.Their words
If one or more systems suddenly generate a lot of retries, that's a sign that something is off and you should investigate.
-
korrents.com
structlog is the best Python logging package and the standard library's logging is the worst.Their words
stamina comes with built-in support for the best Python logging package, structlog, with the best logo, thanks to Lynn Root, and falls back to the worst logging package, which is the standard library.
+ 17 more
-
korrents.com
Retries should be logged even when they succeed, otherwise they look like unexplained performance regressions.Their words
Firstly, of course, you want to know that something went wrong, even if it worked out eventually, because otherwise, regular retries look like weird performance regressions.
-
korrents.com
Automated testing matters because you cannot trust yourself to write correct code or to not break it later.Their words
I care a lot about automated testing because I don't trust myself to write correct code and if I did by accident, I don't trust myself to not break it in the future.
-
korrents.com
Retry parameters can be tuned as long as the backoff is exponential and has an upper bound.Their words
And these parameters should be fine for most applications. But, of course, you can tune all numbers to your liking as long as it's exponential and has an upper bound.
-
Their words
And while you should retry on a 500 error, retrying on errors in a 400 range, especially 401 and 403, is probably gonna get you banned rather sooner than later.
-
korrents.com
Behaviour that is only implied by a function's defaults adds mental burden when reasoning about code.Their words
If it's just implied by the defaults of a function, one has to know that it does the wrong thing by default, adding mental burden when trying to reason about the behavior of code.
-
Their words
But I've always said Tenacity is wonderful. And it truly is. Because it has all the knobs you need to get really great retries.
-
Their words
However, by default, this code will do everything wrong I've just explained to you. It's unbounded. So it will retry until the heat end of the universe or your system, whichever comes first, and has neither a backoff nor a jitter.
-
Their words
One simple one is where you retry only at the edges. So only the first client is allowed to retry. But in sufficiently complex systems, it's unclear where the edge is. No server has complete knowledge of the topology around itself. And it shouldn't.
-
korrents.com
Retries need random jitter, because identical backoffs still make all clients retry at the same time.Their words
But if all clients have the same backoff, they still retry at the same time, so they still take the target down just a little bit later. Which brings us to the final piece of a well-behaved retry. We add a random amount of time to each backoff to spread out the retries.
-
korrents.com
Forgetting timeouts on remote calls is as dangerous as unbounded retries and can take down whole companies.Their words
Forgetting to use timeouts on everything remote is the kissing cousin of unbounded retries. It can literally take down whole companies at once, blocking calls, start cascading until everything ends up in a standstill.
-
korrents.com
Retries must stop eventually because not everything recovers within a useful time frame.Their words
But it also means that you have to stop trying eventually because not everything recovers within a time frame that makes sense for your operation.
-
korrents.com
Because the cause of a failure is unknown, retries should start with a short backoff and increase it exponentially.Their words
And of course, you don't know which of those reasons is at play. So you need to cater to all of them by starting with a short backoff and then exponentially increase every failed retry.
-
Their words
So yeah, big picture. The danger is that you might run a distributed denial of service attack against yourself.
-
korrents.com
A system not designed for reliability and failure will demand a lot of manual work instead of new development.Their words
So if you don't design your systems for reliability, you won't get a robust system. Period. And because failure is inevitable, a system that is not built for failure will make you do a lot of manual work to keep things working instead of building cool new stuff.
-
Their words
At certain scale and under real-world conditions that we all live under, regardless of your level of denial, every system is flaky. And the more components it takes to do its job, aka how complex it is, the more things and the more connections between things can fail, which makes it flakier.
-
korrents.com
Indiscriminate retries can take down whole systems.Their words
However, the lesser-known proverb is, if you indiscriminately try, try, try again, you can take down whole systems, your systems.
-
Their words
So you see, the difference between a robust system that lets you sleep at night and a system that everybody mocks on social media is how you deal with failure. And fortunately, most of failures are temporary.
2 September 2024
-
Their words
You can also disregard claims that virtual environments measurably affect your application's runtime performance.
Nothing matches.
What is a korrent?
A korrent is a belief a person has stated in their own words: one sentence stating the claim, backed by a quote and a source, kept at korrents.com.
Under a name here, the quoted block is what they actually said. The korrent beneath it is the claim those words support, in korrents' wording — tap it to see the record, its source, and who else holds it.
Nobody here wrote their own korrents. They are compiled from public statements, and a person can change their mind, which is recorded too.
About the English under a post
Some people here publish in a language other than English. Where they do, this site shows a machine translation beneath the post, in this typeface — the site's own, not theirs.
The post itself is never changed, moved or hidden: what is set in the serif above is exactly what the person published, and it is what to quote them on. A translation can be wrong in ways that matter, especially about tone.
Only the post's own words are translated. A quoted post, a linked article and a belief on korrents.com are left in their original language.