Re: Python3 cffi bindings

Subject: Re: Python3 cffi bindings

Date: Thu, 17 Oct 2019 19:35:19 +0200

To: David Bremner,


From: Floris Bruynooghe

On Mon 14 Oct 2019 at 09:42 -0300, David Bremner wrote:

> David Bremner <> writes:
>> The shim in
>> doesn't work for me, it doesn't manage to set
>> PYTHONPATH so that notdb is importable.

Ah yes, I tested this shim while activating a venv with the extension
installed using `pip -e .`.

> I should have mentioned that if I manually set python path with
> something like
> $ PYTHONPATH=`pwd`/build/lib.linux-x86_64-3.7:$PYTHONPATH pytest-3
> it works OK.  Is there a simple/reliable way of calculating the path
> lib.linux-x86_64-3.7?

It is possible to run this without installing, but it does need a build
step since cffi (in the mode used - which is the recommended mode) needs
to build an extension module.  I did something like this, using my
debian testing system-installed python

$ export PYTHONPATH=$(pwd)/bindings/python-cffi
$ pushd bindings/python-cffi
$ python3 notdb/  # creates notdb/
$ popd
$ pushd test
$ ./

Does that more or less work?  One problem with this is that it will pick
up the system-wide installed notmuch though.  I guess the way to change
this is by tweaking CFLAGS=-I... LDFLAGS=-L... or so when building?  But
than you also have the whole RPATH/LD_LIBRARY_PATH stuff going on as
well.  Does notmuch abstract any of this away already for it's test


notmuch mailing list