From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 2D2D26DE0EC7 for ; Sun, 3 Nov 2019 17:58:14 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.059 X-Spam-Level: X-Spam-Status: No, score=-0.059 tagged_above=-999 required=5 tests=[AWL=-0.058, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YxOIDerHNqRO for ; Sun, 3 Nov 2019 17:58:13 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 0FF616DE0EB8 for ; Sun, 3 Nov 2019 17:58:13 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1iRRPS-0003vh-2g for notmuch@notmuchmail.org; Sun, 03 Nov 2019 20:43:58 -0500 Received: (nullmailer pid 23201 invoked by uid 1000); Mon, 04 Nov 2019 01:39:33 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: python CFFI bindings integration into notmuch build/test Date: Sun, 3 Nov 2019 21:39:22 -0400 Message-Id: <20191104013927.17037-1-david@tethera.net> X-Mailer: git-send-email 2.24.0.rc1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Nov 2019 01:58:14 -0000 This series is on top of a slightly modified version [1] of id:20191008210312.20685-2-flub@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