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 OJXYDvtW+l4DHQAA0tVLHw (envelope-from ) for ; Mon, 29 Jun 2020 21:02:51 +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 yAOxCvtW+l5QaAAA1q6Kng (envelope-from ) for ; Mon, 29 Jun 2020 21:02:51 +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 379459402D1 for ; Mon, 29 Jun 2020 21:02:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B4A346DE13E3; Mon, 29 Jun 2020 14:02:44 -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 ic9u-KdeXHEY; Mon, 29 Jun 2020 14:02:44 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 880976DE13DB; Mon, 29 Jun 2020 14:02:43 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 45F466DE13DB for ; Mon, 29 Jun 2020 14:02:42 -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 ldW4GGtLGXej for ; Mon, 29 Jun 2020 14:02:41 -0700 (PDT) Received: from mail-ej1-f65.google.com (mail-ej1-f65.google.com [209.85.218.65]) by arlo.cworth.org (Postfix) with ESMTPS id D6B416DE13A8 for ; Mon, 29 Jun 2020 14:02:40 -0700 (PDT) Received: by mail-ej1-f65.google.com with SMTP id l12so18214784ejn.10 for ; Mon, 29 Jun 2020 14:02:40 -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=cgCs/ssP+eoaw9sd+qmiDVRGiDDC3vg0VDU9trZt7+s=; b=FXR/aYwFYAo6veQ7wyOhfTVqcT217eMgiHHyuEKv3D/ncqkAKr+siJu7C7uH2MoXnS upnUlZmeltzBFW3eiHb6OLc2/aJI25WvzCsltU48556kSVil8ZwolsIHQ5fFDviFeh6O jOMv8/k5vUVeiGbd0YiftI+PpyM5HA+oESIPV+DFxzz/G/Z5nydCYK7g0vw+ABjBAJf0 Xq5HVU9AsiPoBVgXdbHIPW1msB7mv48Q0LMoZuC7zP9+YVz1f9UXxYICQtH6U+v2OdE5 0QQP7lqCvLTmCsGauGlI8cHce/YyhvQX06UdE41RJqRoefeQ7KxhH5qLZCnBSwj9Q5gk 80sw== 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=cgCs/ssP+eoaw9sd+qmiDVRGiDDC3vg0VDU9trZt7+s=; b=hBCVm5a3tZGvj/WMNTi/Gh7nZZklvDL9rzCjuEakEq5Hm1GsOwYtgVRb79ct4tYhDS hFtf28tUreyckBDhmJp3+uGz7yy+EAvjzODK+Mga4YELZf+m6cL/qNRk4PWXahxzylfD AI34rchhDPXomzfG4x0GEwN4P1aPNvn/t48DTNVBEGInGBKeMjNpSm5GzcaGHryrarJN J5t05I0TYtkyti0uSODtnVe/OLSvoeH4nTAP6iedeWppAa+SVHC2WkxyxVkpvDgSThCM pXx0X1acSszxNAk3ptSac9jw8TCTg2uyh6irwzJixsLoUwaGwvvHRe2LUtoK6L3Fney3 rAvQ== X-Gm-Message-State: AOAM532rJV7M3gTgnoV/ghTAi3nHLlfiw96KINRHxGvj8+WkkvTieHv5 NgqhRqueOuPZQNp7iHaRcmg= X-Google-Smtp-Source: ABdhPJxZaJAl0hRYqhPZJg6fBrxfvxugtCImHbIpSlg7wiFwJ7ZqGWSOKWO4RDqq39ovY0s7O4V2vQ== X-Received: by 2002:a17:907:100a:: with SMTP id ox10mr15081831ejb.351.1593464558125; Mon, 29 Jun 2020 14:02:38 -0700 (PDT) Received: from powell.devork.be (2a02-8388-8480-1180-4c18-fc69-8d8c-22b5.cable.dynamic.v6.surfer.at. [2a02:8388:8480:1180:4c18:fc69:8d8c:22b5]) by smtp.gmail.com with ESMTPSA id w8sm485467ejb.10.2020.06.29.14.02.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jun 2020 14:02:37 -0700 (PDT) Received: (nullmailer pid 76279 invoked by uid 1000); Mon, 29 Jun 2020 21:02:36 -0000 From: Floris Bruynooghe To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 2/2] bindings/python-cffi: update version from global version. In-Reply-To: <87zh8rmfqj.fsf@tethera.net> References: <20200625110045.208558-1-david@tethera.net> <20200625110045.208558-3-david@tethera.net> <87zh8rmfqj.fsf@tethera.net> Date: Mon, 29 Jun 2020 23:02:36 +0200 Message-ID: <87wo3py49f.fsf@powell.devork.be> 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=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=FXR/aYwF; 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.01 X-TUID: dEoazF7C0yB3 On Thu 25 Jun 2020 at 10:34 -0300, David Bremner wrote: > 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. For some reason this is the only mail in this thread I have, so I don't actually know the patch. I think it can be simpler though, is it possible to copy the toplevel version file into bindings/python-cffi/version in the part of the build that would otherwise do the sed magic? Then setup.py only needs to look for the version file in the same directory as itself instead of finding the toplevel of the repo.