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 ALz9Hba8CV/SeAAA0tVLHw (envelope-from ) for ; Sat, 11 Jul 2020 13:20:54 +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 MFD8Gba8CV+rIAAA1q6Kng (envelope-from ) for ; Sat, 11 Jul 2020 13:20:54 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (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 A9980940630 for ; Sat, 11 Jul 2020 13:20:53 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 964891FFEC; Sat, 11 Jul 2020 09:20:40 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 3C8361FCAE for ; Sat, 11 Jul 2020 09:20:36 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id DC9FA613B5; Sat, 11 Jul 2020 09:20:35 -0400 (EDT) Received: (nullmailer pid 1449148 invoked by uid 1000); Sat, 11 Jul 2020 13:20:34 -0000 From: David Bremner To: notmuch@notmuchmail.org Cc: flub@devork.be, David Bremner Subject: [PATCH 2/2] doc: add new python bindings to main documentatation tree. Date: Sat, 11 Jul 2020 10:20:27 -0300 Message-Id: <20200711132027.1449094-2-david@tethera.net> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200711132027.1449094-1-david@tethera.net> References: <20200711132027.1449094-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: DHIRVRNENXEZ3W4RFBX3B4SLUT7AS4GS X-Message-ID-Hash: DHIRVRNENXEZ3W4RFBX3B4SLUT7AS4GS X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 1.53 X-TUID: oUISbsJLPf95 A seperate conf.py and doc directory will be needed if someone wants to build the bindings docs separately from notmuch. --- configure | 4 ++++ doc/conf.py | 8 ++++++++ doc/index.rst | 1 + doc/python-bindings.rst | 5 +++++ 4 files changed, 18 insertions(+) create mode 100644 doc/python-bindings.rst diff --git a/configure b/configure index 177432db..36fe4a9d 100755 --- a/configure +++ b/configure @@ -801,6 +801,7 @@ if [ $have_python3 -eq 1 ]; then if "$python" -c 'import cffi,setuptools; cffi.FFI().verify()' >/dev/null 2>&1; then printf "Yes.\n" have_python3_cffi=1 + WITH_PYTHON_DOCS=1 else printf "No (will not install CFFI-based python bindings).\n" fi @@ -1554,6 +1555,9 @@ EOF if [ $WITH_EMACS = "1" ]; then printf "tags.add('WITH_EMACS')\n" >> sphinx.config fi +if [ $WITH_PYTHON_DOCS = "1" ]; then + printf "tags.add('WITH_PYTHON')\n" >> sphinx.config +fi printf "rsti_dir = '%s'\n" $(realpath emacs) >> sphinx.config # Finally, after everything configured, inform the user how to continue. diff --git a/doc/conf.py b/doc/conf.py index fdff2a2c..94e266af 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -4,6 +4,8 @@ import sys import os +extensions = [ 'sphinx.ext.autodoc' ] + # The suffix of source filenames. source_suffix = '.rst' @@ -22,6 +24,9 @@ for pathdir in ['.', '..']: with open(version_file,'r') as infile: version=infile.read().replace('\n','') +# for autodoc +sys.path.insert(0, os.path.join(location, '..', 'bindings', 'python-cffi', 'notmuch2')) + # read generated config for pathdir in ['.', '..']: conf_file = os.path.join(location,pathdir,'sphinx.config') @@ -50,6 +55,9 @@ else: # the docstring include files exclude_patterns.append('notmuch-emacs.rst') +if not tags.has('WITH_PYTHON'): + exclude_patterns.append('python-bindings.rst') + # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' diff --git a/doc/index.rst b/doc/index.rst index 4440d93a..a3bf3480 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -26,6 +26,7 @@ Contents: man7/notmuch-search-terms man1/notmuch-show man1/notmuch-tag + python-bindings Indices and tables ================== diff --git a/doc/python-bindings.rst b/doc/python-bindings.rst new file mode 100644 index 00000000..e1ad26ad --- /dev/null +++ b/doc/python-bindings.rst @@ -0,0 +1,5 @@ +Python Bindings +=============== + +.. automodule:: notmuch2 + :members: -- 2.27.0