Sign in

Bart Dorlandt

@dreamnetworking.nl
311 followers 247 following 75 posts

(Network) automation above all

PostsRepliesMedia
Bart Dorlandt @dreamnetworking.nl · 21/07/2025
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.
100
Bart Dorlandt @dreamnetworking.nl · 18/07/2025
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.
110
Bart Dorlandt @dreamnetworking.nl · 30/05/2025
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?
110
Bart Dorlandt @dreamnetworking.nl · 28/05/2025
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.
120
Bart Dorlandt @dreamnetworking.nl · 12/03/2025
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.
110
Bart Dorlandt @dreamnetworking.nl · 10/03/2025
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.
120
Bart Dorlandt @dreamnetworking.nl · 13/01/2025
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).
220
Bart Dorlandt @dreamnetworking.nl · 03/01/2025
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 😞 buff.ly/3BPX5WI
031
Bart Dorlandt @dreamnetworking.nl · 01/01/2025
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.
100
Bart Dorlandt @dreamnetworking.nl · 30/12/2024
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)
120
Bart Dorlandt @dreamnetworking.nl · 27/12/2024
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...
020
Bart Dorlandt @dreamnetworking.nl · 25/12/2024
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!
011
Bart Dorlandt @dreamnetworking.nl · 23/12/2024
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.
011
Bart Dorlandt @dreamnetworking.nl · 20/12/2024
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
000
Bart Dorlandt @dreamnetworking.nl · 18/12/2024
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 😀
000
Bart Dorlandt @dreamnetworking.nl · 16/12/2024
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.
000
Bart Dorlandt @dreamnetworking.nl · 16/12/2024
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.
200
Bart Dorlandt @dreamnetworking.nl · 13/12/2024
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
000
Bart Dorlandt @dreamnetworking.nl · 11/12/2024
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
210
Bart Dorlandt @dreamnetworking.nl · 10/12/2024
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.
000
Bart Dorlandt @dreamnetworking.nl · 28/11/2024
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? mustache.github.io/mustache.5.html :-{{
I can not un see this in jinja now :-{{
110
Bart Dorlandt @dreamnetworking.nl · 25/11/2024
This now must be a collector item #infrahub
050
Bart Dorlandt @dreamnetworking.nl · 25/11/2024
Good morning. Post #autocon2 coffee
070
Bart Dorlandt @dreamnetworking.nl · 22/11/2024
Another day another run at #autocon2 Last day of the event. Looking forward to the talks and coffee sessions!
080
Bart Dorlandt @dreamnetworking.nl · 20/11/2024
Had a workshop with NTC by Eric Chou and Jeff Kala. Gained a book 😁
010