Commit graph

18 commits

Author SHA1 Message Date
Michael J Gruber
760431c0a3 test: increase cffi timeout
By default, the test suite uses 2min for other tests and 5s for cffi
tests. Sporadically, this leads to test failures caused by the timeout
on slower or loaded test infrastructure (as seen on ppc64le in Fedora's
infrastructure during branch time).

Increase the cffi timeout to the same 2m=120s.

Signed-off-by: Michael J Gruber <git@grubix.eu>
2022-08-16 04:29:39 -03:00
David Bremner
9ddd13f758 python-cffi: use config_pairs API in ConfigIterator
This returns all of the config keys with non-empty values, not just
those that happen to be stored in the database.
2022-02-16 21:57:22 -04:00
David Bremner
63d3b2b5cf notmuch 0.34.3 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEkiyHYXwaY0SiY6fqA0U5G1WqFSEFAmHbOcMACgkQA0U5G1Wq
 FSEGVA//Vjgripk0eRDIUZrdL/knjDXybbHVz06r+gx+9Rh1b+3MJ8t+VAjeX7OO
 iJns7ZysKgMsQSYFCFk9fTl5m3ECzZFmzY7lmRU2tU6Hz9lUwotN70e+zGBgFE6J
 sGji4YOCrUnpmgb0j0joRD565m74Bi2Z8Pj+qRvo4RcQY5JxczyDtkSnLb9UDo/e
 FNZ4bTlwJL13Jeu8F6BtnCFPxvpac3qlzLIlG327Fz4cFwQ+QoxQIq5i8pnOu3B2
 HBEyOZAgIuONbV/RH/nwt7QmT45Dne1wP/UqocHkiu3yKvsCRLZC0vsejw8/dZ+D
 GQUfJT9EL1AIJa6OvUyF5UtnPMRKgACG2nt5U8M02ubheAAEgUS/FIIm1kgxkqYU
 5dDKHwU12YHDW2/nwOSRBFDV6TSCkskXr9Thr884KCobyPPnhWkN+pKAfyDhwPMc
 MrnMyId3fPrJRPMxoQ7Z8TJV8l/Wd6FIlFowfzk+s6hfV2qgOUZJ2Btrfk8596Sy
 np8usullbhFagYQ1+JX3AvVxLYvtFKmxO/qG6TcBmjBui5ABz7wtizfgwDx5eVJr
 GpzJUKFUKAmZW+15nm3oNdEwFOjdvRouKc03Qv5eCU6wSaOtd9efgntDPcso8ycW
 Us13KJIhwmwDJdaqnlmG5TdlJY9qjFu/VGHt4+I1GNQuswXRIo8=
 =hQCB
 -----END PGP SIGNATURE-----

Merge tag '0.34.3'

notmuch 0.34.3 release
2022-01-09 19:34:58 -04:00
David Bremner
8b737af28b bindings/python-cffi: search for config by default
The previous (pre-0.34.2) constructor searched for a config file but
only if the database path was not specified, and only to retrieve
database.path. Neither of the available options (CONFIG.SEARCH or
CONFIG.NONE) matches this semantics exactly, but CONFIG.SEARCH causes
less breakage for people who relied on the old behaviour to set their
database.path [1]. Since it also seems like the friendlier option in
the long run, this commit switches to CONFIG.SEARCH as default.

This requires a certain amount of updating the pytest tests, but most
users will actually have a config file, unlike the test environment.

[1]: id:87fsqijx7u.fsf@metapensiero.it
2022-01-09 15:16:51 -04:00
David Bremner
9cc026f3da bindings/python-cffi: add matched property to message objects
Existing users of the legacy python bindings use
message.get_flags(Message.FLAG.MATCH) to determine which messages in a
thread matched. Since the bindings don't provide get_flags anymore,
they should provide a property analogous to the existing "excluded"
property.
2022-01-01 11:48:40 -04:00
Floris Bruynooghe
ca4e1d885b Fix error message when using notmuch_status_to_string
The python exception class was incorrectly loading the error message
which resulted in unprintable exception objects.
2021-12-05 08:53:39 -04:00
David Bremner
ac67cd84ee lib: introduce notmuch_database_create_with_config
This takes a config path parameter, and can use that to decide the
new database location.
2021-02-06 19:48:34 -04:00
Jonas Bernoulli
6c84dee531 Fix typos 2020-08-09 21:14:36 -03:00
Floris Bruynooghe
776a54a0e4 Support aborting the atomic context
Since it is possible to use an atomic context to abort a number of
changes support this usage.  Because the only way to actually abort
the transaction is to close the database this must also do so.

Amended by db: Note the limitation requiring close is a limitation of
the underlying notmuch API, which should be fixed in a future notmuch
release.
2020-06-16 08:17:39 -03:00
Floris Bruynooghe
2d895a0119 Make messages returned by Thread objects owned
This reverses the logic of StandaloneMessage to instead create a
OwnedMessage.  Only the Thread class allows retrieving messages more
then once so it can explicitly create such messages.

The added test fails with SIGABRT without the fix for the message
re-use in threads being present.
2020-06-16 08:02:02 -03:00
Floris Bruynooghe
1bca41698a python config access: fix style and KeyError bug
This fixes some minor style/pep8 things and adds tests for the new
config support.  Also fixes a bug where KeyError was never raised
on a missing key.
2020-06-15 21:50:03 -03:00
Floris Bruynooghe
a00f3a1f7a Add missing set methods to tagsets
Even though we use collections.abc.Set which implements all these
methods under their operator names, the actual named variations of
these methods are shockingly missing.  So let's add them manually.
2020-06-15 07:14:11 -03:00
Daniel Kahn Gillmor
018ad3703b Drop deprecated/unused crypto.gpg_path
crypto.gpg_path was only used when we built against gmime versions
before 3.0.  Since we now depend on gmime 3.0.3 or later, it is
meaningless.

The removal of the field from the _notmuch_config struct would be an
ABI change if that struct were externally exposed, but it is not, so
it's safe to unilaterally remove it.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2020-02-19 08:17:49 -04:00
David Bremner
3185830e3a python-cffi: use shutil.which
I was supposed to amend the original patch that added this function,
but somehow I botched that. The original version runs, so make an
extra commit for the tidying.
2019-12-03 08:12:30 -04:00
Floris Bruynooghe
e2df30f7a9 Rename package to notmuch2
This is based on a previous discussion on the list where this was more
or less seen as the least-bad option.
2019-12-03 08:12:30 -04:00
Floris Bruynooghe
a950aa2844 Show which notmuch command and version is being used
This add the notmuch version and absolute path of the binary used
in the pytest header.  This is nice when running the tests
interactively as you get confirmation you're testing the version you
thought you were testing.
2019-12-03 08:12:30 -04:00
David Bremner
e8cb7c7f60 bindings/python-cffi: preserve environment for tests
We'll need this e.g. to pass PATH to the pytest tests

Based on the suggested approach in id:87d0eljggj.fsf@powell.devork.be
2019-12-03 08:12:30 -04:00
Floris Bruynooghe
83c2d15898 Introduce CFFI-based python bindings
This introduces CFFI-based Python3-only bindings.
The bindings aim at:
- Better performance on pypy
- Easier to use Python-C interface
- More "pythonic"
  - The API should not allow invalid operations
  - Use native object protocol where possible
- Memory safety; whatever you do from python, it should not coredump.
2019-12-03 08:12:30 -04:00