Create virtualenvs in project directories

It's quite handy to create the virtual environment aka venv for a python project in the project folder itself. This means: No huge .virtualenvs folder in your home directory with a lot of envs which you will never use again (The one on this computer is 1.2 GB big although I do not work with many Python projects at all(!)). If you are done with a project and delete all local files, the corresponding environment will be gone with it. [Read More]

Why does poetry not use the specified Python version?

TL;DR: There is only one way to install poetry proper and that is with the installer script provided by the project itself. I was sweating for the better part of an afternoon with a colleague about this. I had installed poetry, the new star in the python tooling world and it kept using the global version of Python instead the one for the project at hand, though poetry's own pyproject. [Read More]

Missing system modules in Python

I got to work on a Python code-base in the last days and have been struggling to get to a stable development environment. I learned some lessons along the way. Here is one of them, as it seems to be rather common and causes headaches for many people (a simple search has a whopping half a million hits on Google). The error ModuleNotFoundError: No module named '_lzma' [Read More]

Consume HTTP APIs lazily

TL;DR: Using lazy sequences for API consumption has advantages in memory consumption and promotes interactive development. HTTP APIs are ubiquitous and consuming them is a programming task coming up quite regularly (at least for me). Therefore I found the following idiom pretty useful, which turns a paginated, remote data source (in this case the GitHub jobs API) into a lazy sequence: (defn- fetch-lazy-jobs-seq! ([] (fetch-lazy-jobs-seq! 0)) ([page] (let [jobs-url (fn [page](format "https://jobs. [Read More]

Making REPL driven development easy with leiningen

TL;DR: Leiningen provides facilities that make using a REPL driven workflow a breeze. You should consider using them on your projects for a more pleasant development experience. Make your system reloadable First of all the application should be reloadable, that means restartable in the REPL without restarting the entire process. If the app can shutdown and start quickly, this makes development way faster, less error prone and more pleasing experience. [Read More]

Clone all those gitlab repositories

If you change work environments once in a while you know that there is one thing that you are doing quite a lot of when starting off: Cloning quite a lot of repositories. Microservices, git and infrastructure as code among other things have let to a big number of repositories in almost all organizations. As I was doing that the last time it got really tedious. Mainly because I wanted to search the whole code base and that did not work with the local gitlab instance. [Read More]

Thinkpad Ultra Dock Annoyances

Just a few days ago I finally fixed an annoyance with my Thinkpad T460p and the Ultra Dock: Removing the laptop from the Dock results in it going into hibernation. Then after opening the lid it does not switch the built in screen back on. This turns out to be easy to fix. Undocking and docking leads to a lot of events which can be observed by a simple sudo acpi_listen The event that seems to be the most promising is used as a trigger to correct the display settings. [Read More]

Releasing clojure libs

Releasing libraries is a tedious but important task.There is lots to do and lots to screw up: Tagging the release state Making a clean build Signing the artifacts Pushing them to some repository Bumping the version to the next snapshot iteration And so on and so forth… Having a dark past in the java world I looked for something like the maven release plugin for leiningen, which automates the whole process quite nicely. [Read More]

Create bugs with overtone

These days I stumbled upon some code committed by a very competent but sadly no longer present colleague and was baffled to see this: catch (Throwable t (log/error t "horrible things happend)) This left me puzzled and after looking for clues why this had been done (and not finding any) I decided to remove this exception dodger and move on. Turns out I created a bug. Why? Because this code was called in a job scheduler from the very popular overtone/at-at library. [Read More]