unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 2f20e17f3adc30f64ea529afa76342f077094302 2144 bytes (raw)
name: bindings/python-cffi/README 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
 
notmuch2 - python3 compatible bindings to notmuch

These bindings use CFFI to generate the bindings making it work well
with both CPython and PyPy.  They try to ensure all operations
from within Python are safe and handle the memory management themselves.

Building notmuch2
-----------------

The provided setup.py file can be used to build and install the
bindings.  You will need python3, setuptools and cffi installed for
this to work.

By default this will assume that the C compiler can find both
notmuch.h and libnotmuch.so.5, if these are installed in a system-wide
location they will normally be found there.  When building notmuch
with make it will ensure that the C compiler finds the in-tree version
of notmuch instead of any system-wide one which might be available.
However the resulting python module is not relocatable and is mainly
used by the notmuch test suite.  For installing your own notmuch
python package it is recommended to first install libnotmuch system
wide and than use setup.py to build and install the python package.

If you really need to customise your build environment, have a look at
the INCUDE_DIRS, LIBRARY_DIRS and EXTRA_LINK_ARGS variables in
notmuch2/_build.py.

Documentation
-------------

The package has extensive docstrings, these docs are also included in
the general notmuch sphinx documentation.  See the notmuch `doc/`
subdirectory for this.


Development
-----------

An easy way to work on the bindings themselves is to create a
virtualenv to work in.  Install the python bindings in editable mode
using:

$ cd bindings/python-cffi
$ pip install -e .

However as described above this will build against the system-wide
notmuch installation.  If you need to work on the currently developed
libnotmuch you can invoke pip with some extra --global-option
arguments.  This is rather verbose, so the pip-editable-build.sh
script does this for you:

$ make
$ cd bindings/python-cffi
$ ./pip-editable-build.sh

Tests are written using pytest and can be run using:

$ pip install pytest pytest-cov
$ pytest

Individual tests can be selected:

$ pytest tests/test_database.py::TestCreate::test_create

debug log:

solving 2f20e17f ...
found 2f20e17f in https://yhetil.org/notmuch/20201122162353.63824-2-flub@devork.be/

applying [1/1] https://yhetil.org/notmuch/20201122162353.63824-2-flub@devork.be/
diff --git a/bindings/python-cffi/README b/bindings/python-cffi/README
new file mode 100644
index 00000000..2f20e17f

Checking patch bindings/python-cffi/README...
Applied patch bindings/python-cffi/README cleanly.

index at:
100644 2f20e17f3adc30f64ea529afa76342f077094302	bindings/python-cffi/README

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).