Commit graph

563 commits

Author SHA1 Message Date
David Bremner
eaf3cd10db doc/python: correct wording around container complexity.
Based on a suggestion from Jakub Wilk.
2025-03-18 09:15:16 -03:00
Michael J Gruber
5802f5d626 bindings/python-cffi: fix docstring for message.header()
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.
2025-03-13 21:18:15 -03:00
Johannes Larsen
e8261872dc ruby: fix "undefining the allocator of T_DATA" warnings
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
2025-03-08 10:39:22 -04:00
Floris Bruynooghe
ed29a9c37e python: Fix message ID docstring
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.
2025-02-28 11:31:55 -04:00
David Bremner
8bc1fccbf9 bindings/python: strip ~ from python version
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.
2025-02-22 07:10:13 -04:00
David Bremner
d526797ad1 python: move legacy python bindings to contrib.
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.
2025-02-22 07:01:47 -04:00
David Bremner
9782c86511 python: fix documentation typo
The method is actually called 'getall'.
2025-02-22 06:59:48 -04:00
Lars Kotthoff
9c1f6cf746 fix segfaults in Python cFFI API and add tests
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.
2025-02-07 12:13:16 -04:00
David Bremner
409ad6b2a8 Revert "bump versions to 0.39~rc0"
This reverts commit deea909993.
2025-01-26 11:30:28 -04:00
David Bremner
deea909993 bump versions to 0.39~rc0
Prepare to release a snapshot for testing
2025-01-26 09:45:20 -04:00
Fredrik Lönnegren
969b26704d docs: Update intersphinx_mapping
Running `make dirhtml` in bindings/python/docs generates the following
error:

```
sphinx-build -b dirhtml -d build/doctrees   source build/dirhtml
Running Sphinx v8.0.2
loading translations [en]... done
making output directory... done
Converting `source_suffix = '.rst'` to `source_suffix = {'.rst': 'restructuredtext'}`.
ERROR: Invalid value `None` in intersphinx_mapping['https://docs.python.org/']. Expected a two-element tuple or list.
```

This commit updates intersphinx_mapping to follow the latest docs [1]

[1] https://www.sphinx-doc.org/en/master/usage/extensions/intersphinx.html

Signed-off-by: Fredrik Lönnegren <fredrik@frelon.se>
2024-12-08 09:07:45 -04:00
David Bremner
d0469c5b4c version: bump to 0.38.3 2024-03-09 22:51:31 -04:00
David Bremner
21daefc178 version: bump to 0.38.2 2023-12-01 07:38:55 -04:00
David Bremner
551ec61118 version: bump to 0.38.1
No changes from 0.38.1~rc1
2023-10-26 19:45:04 -03:00
David Bremner
4fc79eb196 version: update to 0.38.1~rc1 2023-10-12 19:52:42 -03:00
David Bremner
50aaab91b5 version: update to 0.38.1~pre0
Start preparations for point release
2023-09-23 08:12:06 -03:00
David Bremner
60b5ea319a bindings/python-cffi: clean up notmuch2.egg-info
This is created (at least) by the Debian build, but there seems no
harm in cleaning it for everyone.
2023-09-12 08:37:38 -03:00
David Bremner
b21747e0c3 build: clean up __pycache__ directories
These are generated indirectly by certain uses of python in the build.
2023-09-12 08:07:37 -03:00
David Bremner
32f24b97d0 bindings/python-cffi: clean up _notmuch_config.py
_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.
2023-09-12 07:37:32 -03:00
David Bremner
139ea43f3d version: bump to 0.38 2023-09-11 19:56:21 -03:00
David Bremner
ed5b8f65fc version: bump to 0.31~rc2 2023-09-03 09:09:22 -03:00
David Bremner
240e9fff90 version: bump to 0.38~rc1 2023-08-26 08:29:45 -03:00
David Bremner
2f874fb2cc version: set up 0.38~rc0 2023-08-24 07:58:19 -03:00
Michael J Gruber
3771832b01 python: adjust legacy bindings to py 3.12
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.
2023-07-09 11:43:21 -03:00
Felipe Contreras
95a4bf3817 ruby: db: reorganize initializer
In order to make it more extensible.

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-05-29 07:51:02 -03:00
Felipe Contreras
afa45bd6b8 ruby: query: fix get sort
The order was wrong, right now `query.sort` doesn't return a number.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-05-25 07:02:59 -03:00
Felipe Contreras
e4d75fcc83 ruby: remove FileNames object
Not used anymore now that we return an array of strings directly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-04-12 07:30:01 -03:00
Felipe Contreras
837426d7be ruby: filenames: return string array directly
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-04-12 07:29:48 -03:00
Felipe Contreras
777b02a7d7 ruby: add filenames helper
Right now it doesn't do much, but it will help for further
reorganization.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-04-12 07:05:23 -03:00
Felipe Contreras
44924a6a09 ruby: remove Tags object
Not used anymore now that we return an array of strings directly.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-04-02 19:11:10 -03:00
Felipe Contreras
3a52290609 ruby: tags: return string array directly
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-04-02 19:10:55 -03:00
Felipe Contreras
ae1336dea5 ruby: add tags helper
Right now it doesn't do much, but it will help for further
reorganization.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-04-02 19:00:49 -03:00
Felipe Contreras
4152e1bc20 ruby: database: make path arg optional
It can be automatically loaded from the configuration now.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-03-31 07:56:03 -03:00
Felipe Contreras
83ea220178 ruby: use database_open_with_config
Fixes warning:

  warning: ‘notmuch_database_open’ is deprecated: function deprecated as of libnotmuch 5.4

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2023-03-31 07:53:00 -03:00
David Bremner
6d53ee99b3 version: update to 0.37 2022-08-21 13:21:40 -07:00
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
676a470821 version: update to 0.37~rc0 2022-08-14 06:53:41 -03:00
David Bremner
db44af75ad bindings/python-cffi: fix docstring
the method Database.get_message does exist any more (if it ever
did). This makes the docstring unhelpful as an example.
2022-07-05 07:34:25 -03:00
David Bremner
3f27cce71f lib: add NOTMUCH_STATUS_CLOSED_DATABASE, use in _n_d_ensure_writable
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.
2022-06-25 16:06:18 -03:00
David Bremner
f93a2c7383 version: bump to 0.36 2022-04-25 08:45:12 -03:00
David Bremner
8f9dbff49e version: bump to new release candidate 2022-04-16 08:26:27 -03:00
David Bremner
d87d780ef0 version: bump to 0.36~rc0 2022-04-15 08:42:22 -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
b87373f8c4 version: bump to 0.35 2022-02-06 13:11:32 -04:00
David Bremner
addeb11e37 version: bump to 0.35~rc0
Start release process for 0.35
2022-01-29 18:12:58 -04:00
David Bremner
fad2e7540b lib/open: no default mail root in split configurations
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.
2022-01-15 15:59:39 -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
a226b7a29b version: bump to 0.34.3 2022-01-09 15:35:12 -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
22e04ed01a Merge branch 'release' 2022-01-09 09:20:56 -04:00