From: Floris Bruynooghe <flub@devork.be>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: Python3 cffi bindings
Date: Thu, 17 Oct 2019 19:35:19 +0200 [thread overview]
Message-ID: <877e53tgvc.fsf@powell.devork.be> (raw)
In-Reply-To: <87zhi3a46q.fsf@tethera.net>
On Mon 14 Oct 2019 at 09:42 -0300, David Bremner wrote:
> David Bremner <david@tethera.net> writes:
>
>> The shim in
>> T391-python-cffi.sh 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/_build.py # creates notdb/_capi.cpython-37m-x86_64-linux-gnu.so
$ popd
$ pushd test
$ ./T391-pytest.sh
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
suite?
Cheers,
Floris
next prev parent reply other threads:[~2019-10-17 17:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-08 21:03 Python3 cffi bindings Floris Bruynooghe
2019-10-08 21:03 ` [PATCH] Introduce CFFI-based python bindings Floris Bruynooghe
2019-10-08 22:24 ` Python3 cffi bindings David Bremner
2019-10-09 18:34 ` Floris Bruynooghe
2019-10-14 12:40 ` David Bremner
2019-10-14 12:42 ` David Bremner
2019-10-17 17:35 ` Floris Bruynooghe [this message]
2019-10-20 12:22 ` David Bremner
2019-10-22 16:32 ` David Bremner
2019-10-25 9:57 ` Floris Bruynooghe
2019-11-04 10:27 ` Gaute Hope
2019-11-16 16:44 ` David Bremner
2019-12-04 20:18 ` Tomi Ollila
2019-11-17 17:14 ` Floris Bruynooghe
2019-11-17 18:01 ` Gaute Hope
2020-10-08 8:13 ` Gaute Hope
2020-10-14 20:23 ` Floris Bruynooghe
2020-10-16 7:19 ` Gaute Hope
2020-10-16 7:24 ` Gaute Hope
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=877e53tgvc.fsf@powell.devork.be \
--to=flub@devork.be \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).