Toolchain is at PyCon US 2021

PyCon US, the largest Python conference, is getting under way, and Toolchain has a strong presence this year! In fact, we’re thrilled to announce that Toolchain was selected as one of just a handful of startups to be featured in Startup Row, a showcase of new ventures and technologies…

Introducing Pants v2

There are so many tools in the Python development ecosystem. Installing, configuring and orchestrating them—all while not re-executing work unnecessarily—is a hard problem, especially as your codebase grows. Fortunately, there is now a tailor-made (pun intended) solution: Pants v2! Toolchain has been a lead contributor to the Pants…

Election day is a company holiday

Voting is a critical part of our democratic process.  Your vote matters! Politicians wouldn't be fighting so hard over raising or removing barriers to voting if it didn't. One of those barriers is the fact that election day is not a national holiday. This makes it harder for working people…

Meetup Talk on Python and Build Systems

This Wednesday, May 13th, our co-founder Benjy Weinberger will be speaking at the SF Python meetup about how Python 3 helps us create our distributed build system. Of course, times being what they are, the meetup will be virtual and Benjy will be speaking via Zoom... But if you're interested…

os.walk has a major gotcha

Python's os.walk is a very useful idiom for recursively iterating over a directory. However it has one big gotcha that bit us recently: by default, it silently no-ops if the directory doesn't exist: >>> import os >>> list(os.walk('/nonexistent/dir')) [] However os.…

Introducing Toolchain!

Throughout our careers in software engineering, we’ve each worked on a variety of projects, using various programming languages and frameworks, at several different companies. Yet there was always one experience in common: Builds. Just. SUCKED. In fact, the common bond that unites every developer seems to be that builds…

TIL: Pythons 2 and 3 can coexist under pyenv

pyenv is a wonderful tool for managing multiple Python versions on your system. It uses shims to select a specific interpreter either globally, per-directory or per-shell. I recently learned that you can actually select both a Python 2 and a Python 3 interpreter in a single context. For example: pyenv…

Python 3 text file encoding is still system-dependent

Python 3 assumes a default encoding of UTF-8 in a variety of useful scenarios. For example, s: str = buf.decode() will decode the byte buffer as UTF-8. And similarly for buf = s.encode().  Python 3 also defaults to encoding filenames as UTF-8, and Python 3 source code itself is encoded…

Django migrations directories cannot be namespace packages

Django's migrate command locates migration files for an app by loading a subpackage of the app, named migrations, and then searching that subpackage for modules. Unfortunately, there's a check in the code that does not allow migrations to be a namespace package. In other words, it must contain an __init_…

Terraform boolean gotcha

Terraform coerces the literal booleans false and true (e.g., when used as variable values) to 0 and 1 respectively. As a result, this ternary expression: count = "${var.myboolean == true ? 1 : 0}"unexpectedly always evaluates to 0. You want to use count = "${var.myboolean ? 1 : 0}"Or even just count…