From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EOqyEfSu7F75dwAA0tVLHw (envelope-from ) for ; Fri, 19 Jun 2020 12:26:28 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id SJCSDfSu7F4ZXAAA1q6Kng (envelope-from ) for ; Fri, 19 Jun 2020 12:26:28 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B6F9D94021E for ; Fri, 19 Jun 2020 12:26:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 317396DE10B3; Fri, 19 Jun 2020 05:26:22 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 QzS4yxnT6MKb; Fri, 19 Jun 2020 05:26:21 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id D5F356DE1081; Fri, 19 Jun 2020 05:26:20 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 819056DE1081 for ; Fri, 19 Jun 2020 05:26:19 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 fNF1sGjoPHL2 for ; Fri, 19 Jun 2020 05:26:18 -0700 (PDT) Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by arlo.cworth.org (Postfix) with ESMTPS id 244F06DE1050 for ; Fri, 19 Jun 2020 05:26:18 -0700 (PDT) Received: by mail-wr1-f67.google.com with SMTP id b6so9487403wrs.11 for ; Fri, 19 Jun 2020 05:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:mime-version:content-transfer-encoding:in-reply-to :references:subject:from:to:date:message-id:user-agent; bh=wH40T9Rmp+fs1uq8tgTIoGUBAjCfbR481QecLqCK9H4=; b=Cqx1jbzOk3wUs6hbvSPUtGQltOfVnnipHzTthlwrfCeopWNh0rXtqmk1zCyN/NeAuT +txfx8fiLoaNNEqmn67g0RqWOCstDRUPv+Fyp4iVHfslrfIvTQLMkWPUYOIt3bnatSKY hEr6HQZNUhmMu3fn/x9Pig8jbKBz3Ty751gBHu4rWr594S2Vsv7cirioJBPcK0pkVMak qG7sdT4Yj3wbPAZsE7ViEPMPQU39pwU3GNL2Nl5vb6Ys3EITj7wtcQap1lp9DYzLrHfY 6rXf1nKxERVTzALZBUsShmMbD1GJB2TLJG84wtN2u4Sa/+ZfspaDEddH9NwF56jr8Uh7 z11w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:to:date:message-id:user-agent; bh=wH40T9Rmp+fs1uq8tgTIoGUBAjCfbR481QecLqCK9H4=; b=Rdg8VzkV/cUVoAUSS/1MK3QXw7/zqMbIVU8d6gJmHjUjxNgZdxhQfkwvhbv2Y/mVwN mr6LbDcEiPFz3eQcwUQjHKachtY16BEAix6ohyCHe53zWzPg5PHAyqYIBujlW/cQjfY1 Wj4m1ktdvH6WsdHlBk1QM1BqaSzuaZ+BQdpdtcBsg2pZSa3QoAiKei9SbFnH0ItVUKRv fmZU9ajsGtgpDyeChcH30JzQOOk+PkLetGsRjsnhieQzJN1x6+ilkQ/PSqRDR6c3ArXB NATrb7GqaOO5Ycdm8nvW3LV8UfpqM6Nj64q/gSfyPDG/qSdJfD3qRY1ZsEwX8GHd26bt xz1Q== X-Gm-Message-State: AOAM532CRbPhwgJHW2ynr0158SOBiBBCG2k9PTKVU0C/+G4MLKkQJL9Q RggV7ukLHx6c+kujf6s5+hz6enve X-Google-Smtp-Source: ABdhPJzvGBvplXkr2lOLx9RByccbdm9JkPe41e2t7xT9A4BbnaTL0CYGcoipRIaS6vT3tG88cOTxqg== X-Received: by 2002:adf:e883:: with SMTP id d3mr3791358wrm.274.1592569575294; Fri, 19 Jun 2020 05:26:15 -0700 (PDT) Received: from localhost (62-210-75-196.rev.poneytelecom.eu. [62.210.75.196]) by smtp.gmail.com with ESMTPSA id v6sm7624072wrf.61.2020.06.19.05.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jun 2020 05:26:14 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20200619094627.360612-2-flub@devork.be> References: <20200619094627.360612-1-flub@devork.be> <20200619094627.360612-2-flub@devork.be> Subject: Re: [PATCH] python-cffi: read version from notmuch version file From: Frank LENORMAND To: Floris Bruynooghe , notmuch@notmuchmail.org Date: Fri, 19 Jun 2020 15:26:13 +0300 Message-ID: <159256957312.2284556.9348455868725621819@localhost.localdomain> User-Agent: alot/0.9.1 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=Cqx1jbzO; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 0.09 X-TUID: FoBln0w35W0B On Fri Jun 19 12:46:28 2020, Floris Bruynooghe wrote: > This keeps it in sync with the main notmuch version which is less > confusing to users. > --- > bindings/python-cffi/setup.py | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/bindings/python-cffi/setup.py b/bindings/python-cffi/setup.py > index 37918e3d..1effcfc6 100644 > --- a/bindings/python-cffi/setup.py > +++ b/bindings/python-cffi/setup.py > @@ -1,9 +1,17 @@ > +import pathlib > + > import setuptools > > > +THIS_FILE = pathlib.Path(__file__).absolute() > +PROJECT_ROOT = THIS_FILE.parent.parent.parent > +with open(PROJECT_ROOT.joinpath('version')) as fp: > + VERSION = fp.read().strip() > + > + > setuptools.setup( > name='notmuch2', > - version='0.1', > + version=VERSION, > description='Pythonic bindings for the notmuch mail database using CFFI', > author='Floris Bruynooghe', > author_email='flub@devork.be', > -- > 2.27.0 It seems that this strategy doesn't work well when the user runs `pip install .` in the `bindings/python-cffi` directory. Apparently all the files are copied to a temporary directory first: https://travis-ci.com/github/pazz/alot/jobs/351377760#L708-L710 It doesn't happen with the original bindings, probably because the version number is stored in `bindings/python/notmuch/version.py`, which is also copied when `pip` runs. Regards, -- Frank LENORMAND