Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 4A287431FD0 for ; Tue, 23 Aug 2011 18:03:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1GpejLVZsskp for ; Tue, 23 Aug 2011 18:03:17 -0700 (PDT) X-Greylist: delayed 1057 seconds by postgrey-1.32 at olra; Tue, 23 Aug 2011 18:03:17 PDT Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by olra.theworths.org (Postfix) with ESMTP id 6A962431FB6 for ; Tue, 23 Aug 2011 18:03:17 -0700 (PDT) Received: from [120.136.5.22] (helo=angrist) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1Qw1b8-00063i-PY for notmuch@notmuchmail.org; Wed, 24 Aug 2011 00:45:39 +0000 Received: by angrist (Postfix, from userid 1000) id C6190200F21; Wed, 24 Aug 2011 12:45:34 +1200 (NZST) From: Michael Hudson-Doyle To: notmuch@notmuchmail.org Subject: [PATCH] Do not import notmuch in setup.py (again). User-Agent: Notmuch/0.7 (http://notmuchmail.org) Emacs/23.1.50.1 (x86_64-pc-linux-gnu) Date: Wed, 24 Aug 2011 12:45:34 +1200 Message-ID: <87d3fvvdqp.fsf@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Wed, 24 Aug 2011 01:03:18 -0000 Revert part of 8826f. As explained in c39b492c, importing notmuch in setup.py breaks make -f debian/rules clean in an environment that does not have notmuch installed already. --- This is my first time using git format-patch, please be gentle :-) bindings/python/setup.py | 20 +++++++++++++++----- 1 files changed, 15 insertions(+), 5 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 19b6558..671b0d3 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -2,19 +2,29 @@ import os import re -import sys from distutils.core import setup -dirname = os.path.dirname(os.path.abspath(__file__)) # Package's main folder -sys.path.insert(0, dirname) import notmuch +def get_version(): + file = open('notmuch/__init__.py') + try: + for line in file: + if re.match('__VERSION__\s*=\s*',line) != None: + version = line.split('=', 1)[1] + return eval(version, {}, {}) + finally: + file.close() + raise IOError('Unexpected end-of-file') + +__VERSION__=get_version() + setup(name='notmuch', - version=notmuch.__VERSION__, + version=__VERSION__, description='Python binding of the notmuch mail search and indexing library.', author='Sebastian Spaeth', author_email='Sebastian@SSpaeth.de', url='http://notmuchmail.org/', - download_url='http://notmuchmail.org/releases/notmuch-'+ notmuch.__VERSION__+'.tar.gz', + download_url='http://notmuchmail.org/releases/notmuch-'+ __VERSION__+'.tar.gz', packages=['notmuch'], keywords = ["library", "email"], long_description="""Overview -- 1.7.4.1