The cffi bindings raise a LookupError in case a header is not present.
Adjust the docstring to say so.
The legacy bindings behaved differently, and this is one of the things
to be aware of when migrating to the cffi bindings.
Ruby 3.2 introduced a warning when C-extensions use structs without
redefining the allocation default allocation routine meant for objects.
See https://bugs.ruby-lang.org/issues/18007 for details.
In the Ruby bindings this happens at `Data_Wrap_Notmuch_Object` call
sites, so the object types used there needed to update their allocation.
This ruby code (given a database at the hardcoded path with messages
matching `tag:tmp`) exercise all the ruby objects:
require 'notmuch'
Notmuch::Database.open File.expand_path("~/mail") do |db|
db.get_directory("/tmp")
db.query("tag:tmp").search_threads.each do |t|
t.messages.each do |m|
puts m.header("Subject")
end
end
end
Before these changes with ruby 3.2.5 and notmuch 0.38.3 it outputs:
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Query
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Threads
notmuch.rb:5: warning: undefining the allocator of T_DATA class Notmuch::Thread
notmuch.rb:6: warning: undefining the allocator of T_DATA class Notmuch::Messages
notmuch.rb:6: warning: undefining the allocator of T_DATA class Notmuch::Message
notmuch release 0.38.3 now available
(the last line is the message I tagged with tmp), and after the changes:
notmuch release 0.38.3 now available
The messageidb attribute does not exist. The returned BinString type
already allows use as both strings and binary. Presumably this was
written before that type was adopted.
Inspired by a suggestion of Xiyue Deng, this change ensures that
the python bindings have a version that recent setuptools is happy
with.
This will have the unfortunate side effect of the python view of the
version number differing from the rest of notmuch for the
pre-releases. The alternative would be to transform the version
numbers for the Debian packages for the pre-releases, as there is now
no version scheme that works for both, since setuptools started
rejecting versions with "~" in them. If we decide to go the latter
way in the future, this change is easy to revert.
This forces us to verify the build and test suite completes without
the legacy python bindings.
As of this commit the legacy python bindings are unsupported by
notmuch. They are provided in contrib/ for now, but will most likely
eventually be removed from there as well. We recommend that
downstream/distro packagers phase out their packages for the legacy
python bindings.
Several iterators in the Python cFFI API destroyed the objects they iterated
over too early (when the iterator was exhausted), causing subsequent segfaults
in common cases like creating a list from the iterator. This patch fixes the
segfaults and add tests to ensure that they don't happen again.
_notmuch_config.py is generated by configure, and cannot be cleaned up
by the current python build system, since it is imported as a module
by that same build system.
Use DISTCLEAN rather than CLEAN for consistency with other configure
related things.
Py 3.12 finally pulled the plug on the `SafeConfigParser` class which
has been deprecated since py 3.2.
We use it in the legacy bindings only, so take the easy route of
importing `ConfigParser` as `SafeConfigParser` and monkey-patching so
that the class has the expected interface.
Fixes warning:
warning: ‘notmuch_database_open’ is deprecated: function deprecated as of libnotmuch 5.4
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
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>
In order for a database to actually be writeable, it must be the case that it
is open, not just the correct type of Xapian object. By explicitely
checking, we are able to provide better error reporting, in particular
for the previously broken test in T566-lib-message.
If we know the configuration is split, but there is no mail root
defined, this indicates a (lack of) configuration error. Currently
this can only arise in XDG configurations.
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