python CFFI bindings integration into notmuch build/test

David Bremner david at tethera.net
Sun Nov 3 17:39:22 PST 2019


This series is on top of a slightly modified version [1] of

     id:20191008210312.20685-2-flub at devork.be

If you want to try out the new bindings, you can try the branch wip/cffi in the repo
https://git.notmuchmail.org/git/notmuch

One current annoyance is that the version of pytest on travis is too
old for what is specified in tox.ini.

[1]: the diff is as follows.

diff --git a/bindings/python-cffi/notdb/_build.py b/bindings/python-cffi/notdb/_build.py
index 97ad7808..6be7e5b1 100644
--- a/bindings/python-cffi/notdb/_build.py
+++ b/bindings/python-cffi/notdb/_build.py
@@ -13,6 +13,8 @@ ffibuilder.set_source(
         #error libnotmuch version not supported by notdb
     #endif
     """,
+    include_dirs=['../../lib'],
+    library_dirs=['../../lib'],
     libraries=['notmuch'],
 )
 ffibuilder.cdef(
diff --git a/bindings/python-cffi/tests/conftest.py b/bindings/python-cffi/tests/conftest.py
index 1b7bbc35..aa940947 100644
--- a/bindings/python-cffi/tests/conftest.py
+++ b/bindings/python-cffi/tests/conftest.py
@@ -5,6 +5,7 @@ import socket
 import subprocess
 import textwrap
 import time
+import os
 
 import pytest
 
@@ -32,10 +33,11 @@ def notmuch(maildir):
         """
         cfg_fname = maildir.path / 'notmuch-config'
         cmd = ['notmuch'] + list(args)
-        print('Invoking: {}'.format(' '.join(cmd)))
+        env = os.environ.copy()
+        env['NOTMUCH_CONFIG'] = str(cfg_fname)
         proc = subprocess.run(cmd,
                               timeout=5,
-                              env={'NOTMUCH_CONFIG': str(cfg_fname)})
+                              env=env)
         proc.check_returncode()
     return run

t



More information about the notmuch mailing list