Ephes Blog

Miscellaneous things. Mostly Weeknotes and links I stumbled upon.

Date -

Weeknotes 2023-01-30

, Jochen
Your honor my client is no longer in their villain era --@ItsMattsLaw

At work, I had to find out that Python enums are slow when used as keys in a dict. I would never have guessed that some_enum.__hash__() is the main occupation of the software I wrote. Unfortunately, I won't attend PyConDE this year because I forgot I already bought tickets for btconf which happens on the same date 😭. And I am still not sure whether I should attend DjangoConEU 2023 or EuroPython 2023 - maybe someone is interested in trying to convince me? Also recorded a new podcast episode about PyPy which was a lot of fun. No issues with django-cast this time, all went well. Didn't even have to touch the Django admin. Closed all the issues I opened up last time.

There were also some improvements to django-cast:






TIL: Editable Package Installation

, Jochen

Usually, I use pip -e ../package-directory to install an editable version of a package I use in a different project. Usually I use this method to track a bug or develop a new feature. Some time ago I switched to using flit to build my packages because it supports putting all the configuration in pyproject.toml and is not poetry. Today I had to learn that for a django-packages built with flit but then installed with pip -e the Django template lookup is broken. Using flit install -s works fine though.

Caching Audio File Sizes

, Jochen

The feed generation of Python Podcast was kind of slow. Looking deeper into this using sentry, I found out that for each item in the feed, the size of the audio file has to be fetched via HTTP from S3. Ok, this might explain it 😅.

Here's a complete stream of me fixing the issue by caching the audio file sizes in a JSONField including the deployment to python-podcast.de. The stream is in german.

A few hours later I checked the slow HTTP-operations graph from sentry. Caching seems to work:

Effekt des file size cachings

Weeknotes 2023-01-23

, Jochen
That’s why Tesla is right about banning remote work. I know a guy who claims to work for Tesla but also has a gig at a Telcom, at a freight company, does a side job digging holes, sells medical implants AND trades crypto. But he spends most of his time shitposting on twitter. --@avsa

Had to work quite a bit and went to the Django Meetup Cologne and a PyDDF event which I both enjoyed very much. I'm also looking forward to attending PyCon DE & PyData Berlin 2023 in April. For django-cast I fixed a little issue raising an exception when an unknown language is set for a code block. But then there was also a bigger change splitting posts into post and episode models which is at least partly covered in a live stream.

In other news: Snow!






Out of Context Images

Wagtail - Splitting up Posts and Episodes

, Jochen

Until now, posts and episodes were the same things in django-cast. But there are some attributes needed for podcast episodes that don't make much sense for normal blog posts like iTunes keywords or whether an episode should be excluded from iTunes or even the audio object that should be used for the episodes enclosure tag in the podcast feed. Maybe it is possible to move the podcast-specific attributes into a new episode page model and get rid of them in a normal blog post? This would make django-cast more usable for people who don't want to set up a podcast but a normal blog.

The stream is a little bit rougher this time, because I wasn't able to prepare anything beforehand. And I had to end the stream early because of other duties. But about an hour after the stream ended, I had the new episode model live in production 🎉.