Bart Dorlandt
dreamnetworking.nl
Bart Dorlandt
@dreamnetworking.nl
(Network) automation above all
As a first in the pydantic series, let's start with the basics. The goal of the whole series is to be able to validate the model as well as being able to generate the same json as the input, to verify we didn't miss anything.
July 21, 2025 at 9:38 AM
I've working on parsing a json structure into a pydantic model. I'm planning to write a couple of posts on this. Is this something you've been playing with?
Anything specific you ran into?

Perhaps I could write about something specific if you have certain interests. Please let me know.
July 18, 2025 at 9:38 AM
Most of us already got used to annotate our #python code with typehints. If I had to guess, I would say that most people are using #mypy for checking the types.

Did you know that other checkers have emerged these days?
May 30, 2025 at 9:38 AM
When I encountered #uv I fell for it right away. I was already using ruff for a while and started looking into rye, which was the intermediate step before it became uv.
May 28, 2025 at 9:38 AM
Previously I share a post on how you can use `uv run -s script.py` to run that script and have `uv` handle the dependencies. The original script is showing the shebang is pointing to a python3 executable.
March 12, 2025 at 10:38 AM

Ever wanted to run a python script, without having to specify a virtualenv?

Given buff.ly/cVEXJle we can build scripts as we would normally, though now add a few comments to it to specify the dependencies.
March 10, 2025 at 10:38 AM
Poetry had a new release recently, version 2.0. Given the number, this means stuff broke ;) E.g. the poetry shell command is no more. The pyproject.toml is updated and now supporting the project header. (PEP 621)

This also meant I had to update my ansible role for poetry (bartdorlandt.poetry).
January 13, 2025 at 9:36 AM
I've written an article on linkedIn on my tool to migration from poetry to uv. Having uv is awesome, though the migration of each repo isn't...

This tool will make your life a bit easier. Have fun 😞

https://buff.ly/3BPX5WI
January 3, 2025 at 9:36 AM
Wouldn't it be great if Apple had a decent fix for the #notch on the Macs...
Every time I have the Mac disconnected from the external monitor I'm annoyed by it. This time it was enough and I started looking into "fixing" it.
January 1, 2025 at 9:36 AM
Another beautiful feature of #task is to include other taskfiles. Especially to have them OS specific where desired.

Just include the desired #taskfile. Use `{{OS}}` to make it dynamic, allowing variables or tasks to be OS dependent. Useful for developing on Mac and running on Linux (or pipelines)
December 30, 2024 at 9:36 AM
Depending on the pipeline system you're using, you might need to specify the commands to be executed yourself (jenkins, gitlab, ...)

Hang on... You just created that beautiful #taskfile to make your life easier... Why not make your pipeline easier, by just executing your tasks...
December 27, 2024 at 9:36 AM
Using parallelisation without thinking!

That is what you can achieve with the `deps` keyword in #task. See the example on how to run your #python lint, scan and test in parallel by just running `task check`.

No complications, just actions!
December 25, 2024 at 9:36 AM
You are expanding your #taskfile and realise that there a couple of tasks with dependencies on a build process.

Though you don't want to rebuild it, if nothing changed. #Task got you covered!

Using sources and generates to monitor the source files and if the generated file exists.
December 23, 2024 at 9:36 AM
How to deal with #task when needing a dynamic variable or one that is stored in a file or from the output of another command...

Variables can be assigned using the 'sh' key when assigned a variable. Allowing you to assign the output of any shell command.

Lovely
December 20, 2024 at 9:36 AM
As mentioned in my previous post, occasionally you'll need to execute a command in multiple directory or differently said, need to execute a #task multiple times. Which may involve directories, files or any action essentially.

A for loop is what we need 😀
December 18, 2024 at 9:36 AM
That is a lot of magic. It seems someone went all out on the spaces :)

I've worked a bunch with Makefiles as well. That is also the reason I got enthusiastic about Taskfile.
December 16, 2024 at 4:50 PM
You need to run a command for some sub-directories of your project... Doing this with make, you'd need to manually put your logic in to jump back up a dir.
No thinking required with #task. Just add an entry to the array, it always starts from the #taskfile location.
December 16, 2024 at 9:36 AM
You have this beautiful #Taskfile helping you out. Though some systems use exec1 for a certain task, while the other use exec2.

A concrete example could be 'docker-compose' vs 'docker compose'.
Here is a way of working with that.

❯ task a -n
task: [a] docker compose --help
December 13, 2024 at 9:36 AM
The debug capability in vscode/pycharm is great! I can't imagine people debug without it.
I still see too many people not using the watch feature though. It is so nice to just have a few things in focus while diving in. Here is my recommendation to check it out, if you aren't using it full time yet
December 11, 2024 at 9:36 AM
Did you ever run into a #python project which you wanted to debug, but your breakpoints weren't respected...

I had this the other day, having a project with pytest and pytest-cov. Apparently this messes up vscode. Mainly pytest-cov is the blocker. Try this for your launch.json.
December 10, 2024 at 9:36 AM
Something blew my mind today.

In the tech community everyone has touched the jinja templating syntax at one point or another. Today I learned that the double curly braces in the template syntax are called "mustache", who knew?

https://mustache.github.io/mustache.5.html

:-{{
November 28, 2024 at 10:33 AM
This now must be a collector item

#infrahub
November 25, 2024 at 7:03 PM
Good morning.

Post #autocon2 coffee
November 25, 2024 at 7:52 AM
Another day another run at #autocon2

Last day of the event. Looking forward to the talks and coffee sessions!
November 22, 2024 at 2:05 PM
Had a workshop with NTC by Eric Chou and Jeff Kala. Gained a book 😁
November 20, 2024 at 12:02 AM