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 oDHQDWom8V7oNgAA0tVLHw (envelope-from ) for ; Mon, 22 Jun 2020 21:45:14 +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 gLvECWom8V7+LgAA1q6Kng (envelope-from ) for ; Mon, 22 Jun 2020 21:45:14 +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 CCEBF940667 for ; Mon, 22 Jun 2020 21:45:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 8B8A86DE138B; Mon, 22 Jun 2020 14:45:10 -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 cfVK0_pqWc0v; Mon, 22 Jun 2020 14:45:10 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id 2F02B6DE1394; Mon, 22 Jun 2020 14:45:07 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 2DD436DE1394 for ; Mon, 22 Jun 2020 14:45:05 -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 UNaHe3E7ciTD for ; Mon, 22 Jun 2020 14:45:04 -0700 (PDT) Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by arlo.cworth.org (Postfix) with ESMTPS id 470CB6DE138B for ; Mon, 22 Jun 2020 14:45:04 -0700 (PDT) Received: by mail-ej1-f68.google.com with SMTP id n24so19559730ejd.0 for ; Mon, 22 Jun 2020 14:45:04 -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=Pqb+hD0ogVcFknOXvml4jHVtETM41ubPzgcrcmuBIsA=; b=dOWgr6UtXPy7bOUefM7+lok6/JFa/tPkftxTf7yf/+S5zCnj46RyDHaNRszDDJY0b8 Q8yysqmmfIhnEtpMFzVgZAW+LfWEdniDNB2IaKO1/KBimJRL+sgNl3pZr6RL4DiwkhYS lqqGLMTeNI2sEFfZPgV78JOvtmasV8oFXuGdbkU1j6TT3Ybli6pZ1ZDgPa6Y6aFqCo8w XkO8Zj/Jtvt2Z4Pw/HPs8QF2LOLF3U4uaih5K7dGl9inIH9ejH1IjSn+LcRbiZb+kFJV KNTcKZqPqyIG+HV8uq5oODAEg/JBrX7oEfQz0DNE1HnnKRE4S8G6wqXgujEUDjTOIT34 1tpQ== 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=Pqb+hD0ogVcFknOXvml4jHVtETM41ubPzgcrcmuBIsA=; b=toYpHajkIrMmhfJoBBiaRzEXSK2zf2KvZRZ5YG4dDVJxlmmGqj5U4M/X6Dq3SZJ0jY 5pFhxxNrE6PejnOnMB515+NWA5YFPwY+oJm194bfSOU4zpgvhg3OfNFEXCgnI3bqj4Zn 2pXS8ggoos4ouArH9IylOzw1mlVJG1BbBYXPHK6Z81jpKwhudgCAMczY/+ki3QKqSKNP 5O6Q38tKLjHTxB0+iMfslzzNcXpT/xOuKx6sUt0N2zvb9wm2tyHEbK08p8Mn1B7PVwv3 ijsMk/PPxxQicS4p+4EpySwznPHEqa/Gx8pP8gijk4gaTXPa/1gSEYWHVXM1Dvv1z5JY s9JQ== X-Gm-Message-State: AOAM532yxzVcSI/LfYl8jLntrKP1WTo/MztOZDXK080xF8F/B92wE6+M 4gibgZV3RCfyJqjMq73zosU= X-Google-Smtp-Source: ABdhPJzsleGonTTECbUgXrjVMvlwoGvrskAbERrREO86UEE4zK83WtA1aaQmnpOzQWLWidXVmWmZ6w== X-Received: by 2002:a17:906:ca81:: with SMTP id js1mr12260539ejb.369.1592862302795; Mon, 22 Jun 2020 14:45:02 -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 js3sm12305403ejb.65.2020.06.22.14.45.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 14:45:01 -0700 (PDT) Received: (nullmailer pid 13464 invoked by uid 1000); Mon, 22 Jun 2020 21:45:01 -0000 From: Floris Bruynooghe To: Frank LENORMAND , notmuch@notmuchmail.org Subject: Re: [PATCH] python-cffi: read version from notmuch version file In-Reply-To: <159256957312.2284556.9348455868725621819@localhost.localdomain> References: <20200619094627.360612-1-flub@devork.be> <20200619094627.360612-2-flub@devork.be> <159256957312.2284556.9348455868725621819@localhost.localdomain> Date: Mon, 22 Jun 2020 23:45:01 +0200 Message-ID: <87sgemdbc2.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=dOWgr6Ut; 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: jZp9bHjnG0Yv On Fri 19 Jun 2020 at 15:26 +0300, Frank LENORMAND wrote: > 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. Ouch, I only tested pip install -e, which does work. But indeed a plain pip install no longer works which is pretty bad. I guess we could either revert this and do the same sed hackery as the other bindings, or copy the version file into bindings/python-cffi and have it loaded in the same way as now. It would still have to be kept in sync there sadly.