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 0AdYG+Kn9F62SgAA0tVLHw (envelope-from ) for ; Thu, 25 Jun 2020 13:34:26 +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 oAA0F+Kn9F59KgAA1q6Kng (envelope-from ) for ; Thu, 25 Jun 2020 13:34:26 +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 088FF9403EE for ; Thu, 25 Jun 2020 13:34:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 54EE66DE0B36; Thu, 25 Jun 2020 06:34:18 -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 m6hrfyImLY7T; Thu, 25 Jun 2020 06:34:17 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 5FAB06DE0AB2; Thu, 25 Jun 2020 06:34:17 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B2A376DE0A89 for ; Thu, 25 Jun 2020 06:34:15 -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 iuwljFh7L3LI for ; Thu, 25 Jun 2020 06:34:14 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTP id AA14F6DE0A81 for ; Thu, 25 Jun 2020 06:34:14 -0700 (PDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id 0B5FE613BC; Thu, 25 Jun 2020 09:34:14 -0400 (EDT) Received: (nullmailer pid 1055025 invoked by uid 1000); Thu, 25 Jun 2020 13:34:12 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] bindings/python-cffi: update version from global version. In-Reply-To: <20200625110045.208558-3-david@tethera.net> References: <20200625110045.208558-1-david@tethera.net> <20200625110045.208558-3-david@tethera.net> X-List-To: notmuch Date: Thu, 25 Jun 2020 10:34:12 -0300 Message-ID: <87zh8rmfqj.fsf@tethera.net> MIME-Version: 1.0 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=none; dmarc=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.49 X-TUID: nRIiXEepfElM David Bremner writes: > Copy machinery from the older python bindings > > +# get the notmuch version number without importing the notmuch module > +version_file = os.path.join(os.path.dirname(__file__), > + 'notmuch2', 'version.py') > +exec(compile(open(version_file).read(), version_file, 'exec')) > +assert '__VERSION__' in globals(), \ > + 'Failed to read the notmuch binding version number' I wrote a cover letter for this, but that seems to have gotten lost. My main point was I'm not sure why this is better than Floris's version, since they both read a file when setup.py is run. I don't understand (or use) pip, so someone else will have to figure this out. If the constraint is that the version has to be hardcoded in setup.py then (as much as that sounds like a design mistake), we can apply similar sed hackery directly to setup.py. Perhaps someone can remember why we didn't do that for the old python bindings. d