In Patching and Splitting Python Wheels,
I wrote about some occasions when I had to take a Python wheel
and patch it.
Now I want to tell you about a very different approach
that I used recently to patch Airflow wheels.
With the other wheels, we just needed to apply some tactical patches.
With Airflow, we are making substantive changes.
We’ve been using Airflow for years at work.
We built up a lot of infrastructure around Airflow 1
and we are gradually migrating to Airflow 2.
Several years ago, we forked the airflow package
and made a large number of changes to it for internal consumption.
Unfortunately, this made it increasingly hard for us …continue.
I gave lightning talks at Python Ireland in May 2024 and
Puget Sound Programming Python (PuPPy) in August 2024
about patching and splitting wheels: slides.
Patching Wheels
Last year, I wrote about manually Patching a Python Wheel.
There was a cyclic dependency
between the Torch 2.0.1 wheel and the Triton 2.0.0 wheel.
While pip had no problem with this,
Bazel certainly did.
My workaround was to unzip the Torch wheel,
edit the metadata to remove the dependency on Triton,
and zip the wheel up again with a modified name.
At the beginning of this year,
I had to patch Torch 2.1 for different reasons.
Again, I needed to patch the Torch wheel because of Bazel problems.
Due …continue.
The migration away from Twitter has really caught fire lately,
with Bluesky being the obvious winner of new accounts in recent weeks.
I’m available on other platforms, if you want to follow me.
These are sorted from most to least active:
Basically, I’m georgevreilly everywhere,
except for a few old accounts from the 2000s where I used george_v_reilly.
I have a sweatshirt from attending CascadiaJS in 2012
that has @georgevreilly along the length of the left sleeve.
It was either my Twitter or my GitHub handle (which are, of course, identical).
I can also be reached via:
Last year, I posted a recipe for cold brew coffee
using an Oxo Cold Brew Coffee Maker.
Recently, it occurred to me that I could use a French Press instead of the Oxo.
I’ve made several batches, with good results.
It’s a little more convenient to make cold brew in the Oxo,
but it’s good to know that it can be made
without buying special-use equipment.
Ingredients
- 24 fl oz (700 ml) water
- 6 oz (170 g) fresh coarsely ground coffee.
Store-bought pre-ground coffee is too fine.
This will fill a one-quart (one-liter) French Press.
It yields about 16 fl oz (1 pt/500 ml) of cold brew coffee.
Instructions
- Grind the coffee beans coarsely.
- Place the ground coffee in the …continue.
Unless YOUVE LIVED UNDER ROCKS, you've heard of Wordle,
the online word game that has become wildly popular since late 2021.
You've probably seen people posting their Wordle games
as grids of little green, yellow, and black (or white) emojis on social media.
Wordle 797 4/6
β¬ β¬ β¬ β¬ π¨
π¨ β¬ π© β¬ β¬
β¬ β¬ π© π¨ β¬
π© π© π© π© π©
The problem that I want to address in this post is:
Given some GUESS=SCORE pairs for Wordle and a word list,
programmatically find all the words from the list
that are eligible as answers.
Let's look at this four-round game for Wordle 797:
Most regular expression engines make it easy to
match alternations (or disjunctions) with the | operator:
to match either foo or bar,
use foo|bar.
Few regex engines have any provisions for conjunctions,
and the syntax is often horrible.
Awk makes it easy to match /pat1/ && /pat2/ && /pat3/.
$ cat <<EOF | awk '/bar/ && /foo/'
> foo bar
> bar
> barfy food
> barfly
> EOF
foo bar
barfy food
In the case of a Unix pipeline,
the conjunction could also be expressed as a series of pipes:
... | grep pat1 | grep pat2 | grep pat3 | ....
The longest regex that I ever encountered
was an enormous alternationβa true horror that shouldn’t have …continue.
Python enumerations are useful for grouping related constants in a namespace.
You can add additional behaviors to an enum class,
but there isn’t an easy and obvious way
to add attributes to enum members.
class TileState(Enum):
CORRECT = 1
PRESENT = 2
ABSENT = 3
def color(self):
if self is self.CORRECT:
return "Green"
elif self is self.PRESENT:
…continue.
Recently, I had to create a new Python wheel for PyTorch.
There is a cyclic dependency between PyTorch 2.0.1 and Triton 2.0.0:
Torch depends upon Triton, but Triton also depends on Torch.
Pip is okay with installing packages where there’s a cyclic dependency.
Bazel, however, does not handle cyclic dependencies between packages.
We use Bazel extensively at Stripe
and this cyclic dependency prevented us from using the latest version of Torch.
I spent a few days trying to build the PyTorch wheel from source.
It was a nightmare!
I ran out of disk space on the root partition on my EC2 devbox
trying to install system packages,
so I had to bring …continue.
I woke up on Saturday to read on Bram Moolenaar’s Facebook page
an announcement of his death.
I knew Bram online for nearly 30 years and
I was one of his relatively small number of Facebook friends,
but we never met in real life.
I knew that he had retired from Google Zurich to Tenerife,
but I hadn’t been aware that he had been ill.
Bram was known to the world for his signature creation,
the Vim text editor,
used by millions of developers on Linux, macOS, and Windows.
Vim stands for Vi IMproved,
but it outgrew the original vi long ago.
I was an active contributor to Vim in the 1990s:
I wrote a …continue.
I often enjoy cold brew coffee in summer.
I bought an Oxo Cold Brew Coffee Maker one winter
when it was on sale at Bed, Bath & Beyond.
Before that, I used a nut milk bag in a jar.
I like the Oxo and it gets high marks in many reviews,
such as HomeGrounds or Wirecutter.
It’s easy to use, easy to clean, and makes a good brew.
The only downside to making your own cold brew coffee
is that you must plan ahead.
You can make hot coffee in a few minutes,
but cold brew takes hours.
I have used this recipe for a number of years.
It makes a smooth, less acidic coffee.
ETA: …continue.
Previous »