built-google-re2: Python re2 wheels!

1,399 views
Skip to first unread message

Adam Hooper

unread,
Apr 9, 2021, 10:13:56 AM4/9/21
to re2-dev
Hi there,

I love re2. And I love the `google-re2` module. I use it religiously.

... but I hate the install process. In this day and age, I need wheels.

So I made a little build system: https://github.com/CJWorkbench/build-google-re2. It includes a horrid hack, but it's well-documented and maintainable.

To install: `python -mpip install built-google-re2`

To use: `import re2`

The wheels work on manylinux2014, py36+py37+py38+py39. On PyPI: https://pypi.org/project/built-google-re2/

I'd love to upstream this contribution, so that wheels are distributed alongside source code with every relase of google-re2. Can I help make wheels a part of google-re2's Python release process? What's the next step?

Enjoy life,
Adam

Paul Wankadia

unread,
Apr 10, 2021, 3:20:54 PM4/10/21
to Adam Hooper, re2-dev
On Sat, Apr 10, 2021 at 12:13 AM Adam Hooper <ad...@adamhooper.com> wrote:

I'd love to upstream this contribution, so that wheels are distributed alongside source code with every relase of google-re2. Can I help make wheels a part of google-re2's Python release process? What's the next step?

Sorry, the RE2 project releases source code only. We really don't want to get into the binary distribution business.

It would also be weird for google-re2 to provide sans-Abseil source, but avec-Abseil wheels. That could potentially be fixed by forcing the Python extension to link against libre2.a, but I'm not sure whether setuptools would make that easy. Solving that problem and also the problem of obtaining a compatible version of libre2.a should see the build become much simpler.

Adam Hooper

unread,
Apr 10, 2021, 3:53:38 PM4/10/21
to Paul Wankadia, re2-dev
On Sat., Apr. 10, 2021, 3:20 p.m. Paul Wankadia, <jun...@google.com> wrote:
On Sat, Apr 10, 2021 at 12:13 AM Adam Hooper <ad...@adamhooper.com> wrote:

I'd love to upstream this contribution, so that wheels are distributed alongside source code with every relase of google-re2. Can I help make wheels a part of google-re2's Python release process? What's the next step?

Sorry, the RE2 project releases source code only. We really don't want to get into the binary distribution business.

I'm willing to maintain these wheels as a "semi-official partner" or some-such....

The re2 Python package doesn't get the attention it deserves. Every Pythonista should be using it instead of "regex" (a library just as flawed as Python's own `re`). There are at least five PyPi packages for re2; all take a CS degree to install; one gave me segfaults in production.

I'm willing to volunteer a reasonable amount of maintenance to help people discover and install re2. "We don't do binaries" needn't be, "we make it hard to install;" I'm sure that isn't the intent and I'm willing to help.

My objective is to help make re2's syntax and engine as popular as they can be.

How can I help people find and install re2? There is demand for these wheels. I'd like to help with supply. A link from the project page would be a minimum.... Can we do even better?

Enjoy life,
Adam

Paul Wankadia

unread,
Apr 11, 2021, 10:46:37 AM4/11/21
to Adam Hooper, re2-dev
On Sun, Apr 11, 2021 at 5:53 AM Adam Hooper <ad...@adamhooper.com> wrote:

Sorry, the RE2 project releases source code only. We really don't want to get into the binary distribution business.

I'm willing to maintain these wheels as a "semi-official partner" or some-such....

The problem was one of philosophy, not one of effort, but given that PyPI is the package manager for Python and that manylinux is the standard platform for Python, I decided to make an exception for Python.

BTW, as per https://github.com/google/re2/commit/0d8d43fbabc432c1e61219059ef28743f231b6f1, it really wasn't a problem of effort. :)

Adam Hooper

unread,
Apr 12, 2021, 4:25:08 PM4/12/21
to Paul Wankadia, re2-dev
On Sun, Apr 11, 2021 at 10:46 AM Paul Wankadia <jun...@google.com> wrote:
The problem was one of philosophy, not one of effort, but given that PyPI is the package manager for Python and that manylinux is the standard platform for Python, I decided to make an exception for Python.

This is the dream! Thank you, Paul!

Enjoy life,
Adam

--

Paul Wankadia

unread,
Apr 12, 2021, 8:49:33 PM4/12/21
to Adam Hooper, re2-dev
On Tue, Apr 13, 2021 at 6:25 AM Adam Hooper <ad...@adamhooper.com> wrote:

This is the dream! Thank you, Paul!

You're welcome. :)

Reply all
Reply to author
Forward
Message has been deleted
0 new messages