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 140036DE0EC7 for ; Thu, 17 Oct 2019 10:35:26 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.149 X-Spam-Level: X-Spam-Status: No, score=0.149 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 l-4MfLNx8BBW for ; Thu, 17 Oct 2019 10:35:23 -0700 (PDT) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by arlo.cworth.org (Postfix) with ESMTPS id E563F6DE0E7F for ; Thu, 17 Oct 2019 10:35:23 -0700 (PDT) Received: by mail-wm1-f53.google.com with SMTP id i16so3418406wmd.3 for ; Thu, 17 Oct 2019 10:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version; bh=HK2+ZroktpsfdYSqalbE+hK1KZ94xq6u4ppIhXKKrJc=; b=Lmi9UMyfyKAlMRrzm4rbw3Me/3C2Mn1k3rfxbU0BBlNrvQotzrBGa64QMA1VmVCVUi zCS3cLDeKcpmYSzEFLSOrneEHObutzSYq5FJj5sY6qrY+5lJJsUYVB7VM0BxmVlU8TKG 5CaHTSWU6z02LZtx6xCch2EBDJVtPpUPVn4NWcBIOFYf7H+rE0wXB0G6UI256v0WaH5m q9+MP4Ck1Ek1HVxoZhrLZCbOsDFCUHlGXyvHuELNTJhvG2jQKXHwt9T5M2KbD51rkDTu M3mlrUaaW5zXwXiOS4yoWaU+vOm1DadXuDOQUEt/G1n8vAkr5sJ+oBTPlk9kgfAD7140 DKWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:in-reply-to:references :date:message-id:mime-version; bh=HK2+ZroktpsfdYSqalbE+hK1KZ94xq6u4ppIhXKKrJc=; b=Euf0XxK2O6gAXshSerZV4/Sp4b42SPB9MF0l+OQrIBxPo9Qx+bP5uH20jLHIm2LvyJ S+JuWpMLQHnVm19IXY2o6xCTF0BbLwj7VDhhIycABeLjMd6v0f2ileBkJ/PKAVsEITfG nUXQoz1/t0AoduhkBg8VQ2Xg/5Vk+vUVG6dpBoUper7g6IokNV7JuAnfnXyw7NejLiu0 aYaowjcpgvnX6SjoXnY8oYiXW0l/OV9DmNm4zro2D/0nywBGBElL5Xm0ZPqvLoR5Pjpx ykmcHzyfbs2jTZv7JDW3zL/QYC33arSBcYNnzJMyUbANQqhRwMM5kD17CgzWJb4K7w6Q Nknw== X-Gm-Message-State: APjAAAWhvBVwYHpfrwvhEQ/vs1q3jOsGGjcRTfdBzl18w9PfdJWLmrD6 tDclumoY8e9FiCc2btfrMoE= X-Google-Smtp-Source: APXvYqwo88SXphlS9+QPDsA7TMY7q15WPXAK7pbGcYY/06mTLANb2YmPguJj8/nXTaIUa3hGX7wV5A== X-Received: by 2002:a1c:7c13:: with SMTP id x19mr3856940wmc.80.1571333721155; Thu, 17 Oct 2019 10:35:21 -0700 (PDT) Received: from powell.devork.be ([2a02:168:58d0::7a3]) by smtp.gmail.com with ESMTPSA id z189sm3548610wmc.25.2019.10.17.10.35.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Oct 2019 10:35:20 -0700 (PDT) Sender: Floris Bruynooghe Received: (nullmailer pid 25330 invoked by uid 1000); Thu, 17 Oct 2019 17:35:19 -0000 From: Floris Bruynooghe To: David Bremner , notmuch@notmuchmail.org Subject: Re: Python3 cffi bindings In-Reply-To: <87zhi3a46q.fsf@tethera.net> References: <20191008210312.20685-1-flub@devork.be> <8736fvbivq.fsf@tethera.net> <87zhi3a46q.fsf@tethera.net> Date: Thu, 17 Oct 2019 19:35:19 +0200 Message-ID: <877e53tgvc.fsf@powell.devork.be> MIME-Version: 1.0 Content-Type: text/plain 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: Thu, 17 Oct 2019 17:35:26 -0000 On Mon 14 Oct 2019 at 09:42 -0300, David Bremner wrote: > David Bremner 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