unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: david@tethera.net
To: notmuch@notmuchmail.org
Cc: David Bremner <bremner@debian.org>
Subject: [PATCH 2/2] Do not import notmuch in setup.py.
Date: Sun, 19 Jun 2011 16:53:43 -0300	[thread overview]
Message-ID: <1308513223-27163-3-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1308513223-27163-1-git-send-email-david@tethera.net>

From: David Bremner <bremner@debian.org>

Importing notmuch loads the notmuch shared library. When building
without a system install of notmuch, this requires e.g. setting
LD_LIBRARY_PATH for building and fails completely for cleaning.
---
 bindings/python/setup.py |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/bindings/python/setup.py b/bindings/python/setup.py
index e4a3a25..1497bc4 100644
--- a/bindings/python/setup.py
+++ b/bindings/python/setup.py
@@ -1,7 +1,22 @@
 #!/usr/bin/env python
 
+import os
+import re
 from distutils.core import setup
-from notmuch import __VERSION__
+
+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=__VERSION__,
       description='Python binding of the notmuch mail search and indexing library.',
-- 
1.7.5.3

  parent reply	other threads:[~2011-06-19 19:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-19 18:16 [PATCH] Build debian package for python-bindings david
2011-06-19 19:53 ` david
2011-06-19 19:53   ` [PATCH 1/2] Build debian package for python-bindings david
2011-06-19 20:10     ` [PATCH] debian: break up build-depends on separate lines Jameson Graef Rollins
2011-06-20  7:40     ` [PATCH 1/2] Build debian package for python-bindings Sebastian Spaeth
2011-06-19 19:53   ` david [this message]
2011-06-20  7:47     ` [PATCH 2/2] Do not import notmuch in setup.py Sebastian Spaeth
2011-06-23 22:24       ` Carl Worth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1308513223-27163-3-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=bremner@debian.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).