July 18, 2022

Just Enough Bazaar to Be Dangerous

Last year I wrote a blog post about how to migrate from Bazaar, a distributed version control system, originally developed by Canonical, to git. While I still think this is the only way forward, here, at Canonical, working in the Launchpad team, we still have a couple of Bazaar repositories around, which cannot be easily migrated, as they are both integrated into deployment processes, and used by other teams. basic commands to get around Please note: Breezy (brz) is a friendly fork of the Bazaar (bzr) project....

June 27, 2022

Ubuntu Versions Cheat Sheet

about versions, names, even more versions and dates version code name python go debhelper end of standard support eol 14.04 trusty tahr 2.7.5 + 3.4 ? 9 04/2019 04/2024 16.04 xenial xerus 3.5 ? 9 04/2021 04/2026 18.04 bionic beaver 3.6 ? 11 04/2023 04/2028 20.04 focal fossa 3.8 1.13 + 1.14 12 04/2025 04/2030 22....

June 1, 2022

Oh Open Source Supply Chain Security, Where Art Thou?

“This is horrifying. But also not surprising.” These are the words of a friend of mine, a security specialist, when I told him what I found out today. But first… What is Open Source Supply Chain? Most applications nowadays use open source libraries, especially for common functionality like e.g. sending web requests, so it is not necessary to re-invent the wheel all the time. This is great! This saves a lot of work, time and money, and usually when a library is widely used, it is rock stable....

May 23, 2022

Conda, Miniconda and 2x Anaconda

While I certainly heard of Conda, Miniconda, and Anaconda before, I only had a vague idea of these terms and what is behind them. So, let’s get the terminology straight. Conda… what? Conda Conda is a CLI application which does package, dependency and environment management, not only for Python, but also for other languages. Anaconda Anaconda is an open-source Python distribution platform. This is the all-in-one package, containing not only the Conda application, but already many packages which you usually need for a data science project....

April 16, 2022

getattr() Considered Harmful

While Hynek already considered “Considered Harmful” was getting old in 2016, and so he named this blog post hasattr() – A Dangerous Misnomer, instead of hasattr() considered harmful, meanwhile it is 2022 and I still like that phrase. So here we go… getattr() considered harmful The setting is a CLI application with 100% test coverage, and even branch coverage is activated. coverage 101 I assume you know what coverage is. 100% test coverage means that the test suite covers all lines of code of your library or application....

November 30, 2021

Testing Argparse Applications - the Better Way

When you are creating command line applications in Python, you probably heard of argparse, which is a great library for exactly doing this, and it is even included in Python’s standard library. Imagine you have created the following argparse application: <main.py> import argparse def main(): parser = argparse.ArgumentParser() parser.add_argument('--name', required=True) args = parser.parse_args() print(f'Hello {args.name}') if __name__ == '__main__': sys.exit(main()) Looks straightforward, works great, but at one point, you certainly want to add tests for it, right?...

November 21, 2021

Combine Coverage for Different Python Versions

Is it enough to run code coverage for a single Python version? Probably, but not necessarily. Especially when you still need to support Python 2.7 (sigh), there could be quite some different code paths for Python 2 and Python 3. A simple example… try: import Queue # Python 2 except ImportError: import queue as Queue # Python 3 But also the different Python 3 versions may require that you not only test your code for each interpreter, but also you need to assess code coverage for the different versions, and certainly you want to make sure you got all paths covered....

November 9, 2021

Bye-Bye python-memcached, hello pymemcache

For one app that I help maintaining I noticed that python-memcached was used, which has not been updated in several years. There were some efforts to transfer python-memcached to a new maintainer, but at the end that did not work out. So, the project is dead. While an unmaintained project may currently work, there are several things to consider: there may be bugs which do not get fixed there may be security issues which do not get fixed it may stop working for e....

November 5, 2021

Migrate a Repository From Bazaar to Git

Bazaar is a distributed version control system (VCS), developed by Canonical. For a long time, Bazaar was the only supported VCS on Launchpad. Launchpad is a code hosting platform, similar to the now prevalent GitHub, and while open to the public, nowadays it is mostly used by Canonical itself and many other individuals and companies to manage the whole lifecycle of creating packages for Ubuntu and its distributions. Since quite some time also git is a supported VCS on Launchpad....

July 22, 2021

GPG - All I Need to Know

While I need to use GPG pretty regularly, I always have to look up the commands - they just don’t stick :-) Over the last couple of months I collected every command I had to use. Enjoy! create a key gpg --quick-generate-key user-id # or gpg --generate-key # or gpg --full-generate-key delete a private key gpg --delete-secret-keys key-id delete a public key gpg --delete-key key-id encrypt a file gpg --encrypt --recipient someone@example....