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 8D0806DE0F94 for ; Thu, 14 Nov 2019 12:20:13 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.401 X-Spam-Level: X-Spam-Status: No, score=0.401 tagged_above=-999 required=5 tests=[AWL=-0.251, SPF_NEUTRAL=0.652] 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 BK3u2Hazc8Ie for ; Thu, 14 Nov 2019 12:20:12 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id D9B4E6DE0F43 for ; Thu, 14 Nov 2019 12:20:11 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id D15A81000B0 for ; Thu, 14 Nov 2019 22:20:05 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Subject: Re: python CFFI bindings integration into notmuch build/test In-Reply-To: <87blte2su3.fsf@powell.devork.be> References: <20191104013927.17037-1-david@tethera.net> <87eeylspzo.fsf@tethera.net> <87blte2su3.fsf@powell.devork.be> User-Agent: Notmuch/0.28.3+84~g41389bb (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ 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, 14 Nov 2019 20:20:13 -0000 On Thu, Nov 14 2019, Floris Bruynooghe wrote: > Hi, > > Thanks for carrying on with this! > > I'm a little confused with how to follow this, is the current state of > the code somewhere in a repo/branch where I can try things out and make > changes from? In git://notmuchmail.org/git/notmuch David has ref origin/wip/cffi which contains related changes -- You can fetch the code while waiting for more collaboration instructions from David. > On Tue 05 Nov 2019 at 22:22 -0400, David Bremner wrote: > >> Tomi Ollila writes: >> >> >>> alternative: >>> >>> ... >>> print('Invoking: {}'.format(' '.join(cmd))) >>> >>> def preexec_fn(): os.environ['NOTMUCH_CONFIG'] = str(cfg_fname) >>> >>> proc = subprocess.run(cmd, timeout=5, preexec_fn=preexec_fn) >>> ... >>> >>> The unix fork ... (here preexec_fn called in child) ... exec model is >>> superior to any other alternative ! =D >> >> I don't consider myself a good judge of python style, so I'll defer to >> Floris on that one. > > I'd have gone with what David wrote to be fair, mostly because it's > pretty simple to see what's going on where for the preexec_fn I'd have > to look at the docs. Not sure if this has much to do with Python style > though, more with how much you like Unix tricks. Yes, the simple approach taken (by env copy) is fine. It is also good to know these powerful alternatives that may be useful elsewhere =D > > > Cheers, > Floris Tomi