Re: [python-cffi] Version number for the `notmuch2` bindings

2020-06-19 Thread Floris Bruynooghe
On Thu 18 Jun 2020 at 16:56 -0300, David Bremner wrote:

> Frank LENORMAND  writes:
>
>> Hi,
>>
>> The original Python bindings follow the entire repository's version
>> number[1]. The new Python bindings use `0.1`[2].
>>
>> The Debian package[3] follows the same version number as well, but
>> it's starting to confuse maintainers of packages for other environments
>> (e.g. Pypi[4]), who use `0.1` because that's what's in the code.
>
> Floris might have some good reason in mind for the divergence. I will
> say it's a pain in Debian to have different binary packages (.deb's)
> built from the same source with different version numbers. So I'd need
> to be convinced.

There is no good reason, it was overlooked when merging the cffi
bindings into notmuch proper.

Is there any reason we can not directly read the toplevel version file
from inside setup.py instead of having to add sed hackery?

Cheers,
Floris
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Highlight the file attachment

2020-06-19 Thread David Edmondson
On Thursday, 2020-06-18 at 14:11:20 +02, Jörg Volbers wrote:

> Hi there,
>
> When showing a message with notmuch-show, I'd love to highlight 
> the file attachment part. I want to distinguish them from the 
> other mml stuff which I usually do not need to care about. Is 
> there any easy way to determine that part programmatically?

Modifying the button part based on whether the part in question is
structural or leaf should enable you to then apply different formatting.

Structural parts will, I think, always have a :content attribute that is
a list.

> Looking at the text properties in the show buffer, these parts 
> seem to be simple buttons with no special property. If notmuch 
> show would add a text property when inserting these particular 
> buttons, one could simply add a face overlay or something. Or it 
> could be wrapped in a special face.

dme.
-- 
I got a girlfriend that's better than that.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] python-cffi: read version from notmuch version file

2020-06-19 Thread Floris Bruynooghe
This keeps it in sync with the main notmuch version which is less
confusing to users.
---
 bindings/python-cffi/setup.py | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/bindings/python-cffi/setup.py b/bindings/python-cffi/setup.py
index 37918e3d..1effcfc6 100644
--- a/bindings/python-cffi/setup.py
+++ b/bindings/python-cffi/setup.py
@@ -1,9 +1,17 @@
+import pathlib
+
 import setuptools
 
 
+THIS_FILE = pathlib.Path(__file__).absolute()
+PROJECT_ROOT = THIS_FILE.parent.parent.parent
+with open(PROJECT_ROOT.joinpath('version')) as fp:
+VERSION = fp.read().strip()
+
+
 setuptools.setup(
 name='notmuch2',
-version='0.1',
+version=VERSION,
 description='Pythonic bindings for the notmuch mail database using CFFI',
 author='Floris Bruynooghe',
 author_email='f...@devork.be',
-- 
2.27.0

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: python/notmuch2 on PyPI

2020-06-19 Thread Patrick Totzke
Hi everyone,

First off, thanks for your work on notmuch2, Floris!

Just to clarify: alot does not, and will not, depend on packages being on PyPI
and is not intended to be installed through pip. I simply don't want to provide
support for this.

This said, I don't think it is difficult to automate pypi uploads and it cannot
hurt to have an "official" release up there instead of several unmaintained
corpses over the years.

Cheers,
P



Quoting Floris Bruynooghe (2020-06-19 11:35:42)

> Hi Thore, notmuch folks,
> 
> I noticed that Thore published notmuch2 on PyPI.  I think this is
> because alot needs it's users to be able to pull it in as a dependency
> using the normal Python mechanisms?
> 
> It seems this is currently published from a fork at
> https://github.com/weilbith/notmuch2-python-bindings and I wondered if
> it was possible to publish this directly from the main notmuch repo or
> even integrate this into the normal notmuch release process.  What are
> the pros and cons of this?  Is it a bad idea to tie these two publishing
> mechanisms too close together?  To difficult to do bugfix releases?  Is
> it too hard to make pypi publishing frictionless enough for the main
> release process?
> 
> An cool stretch goal would be to publish manylinux wheels with the
> library included.  But let's not get too hung up on that, small steps
> are great.
> 
> Cheers,
> Floris
> ___
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


python-cffi: read version number from notmuch

2020-06-19 Thread Floris Bruynooghe
This reads the version from the toplevel notmuch version file.
The main assumption is obviously that setup.py is always in
bindings/python-cffi/setup.py together with the rest of the
notmuch git repo.


___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


python/notmuch2 on PyPI

2020-06-19 Thread Floris Bruynooghe
Hi Thore, notmuch folks,

I noticed that Thore published notmuch2 on PyPI.  I think this is
because alot needs it's users to be able to pull it in as a dependency
using the normal Python mechanisms?

It seems this is currently published from a fork at
https://github.com/weilbith/notmuch2-python-bindings and I wondered if
it was possible to publish this directly from the main notmuch repo or
even integrate this into the normal notmuch release process.  What are
the pros and cons of this?  Is it a bad idea to tie these two publishing
mechanisms too close together?  To difficult to do bugfix releases?  Is
it too hard to make pypi publishing frictionless enough for the main
release process?

An cool stretch goal would be to publish manylinux wheels with the
library included.  But let's not get too hung up on that, small steps
are great.

Cheers,
Floris
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: python/notmuch2 on PyPI

2020-06-19 Thread David Bremner
Patrick Totzke  writes:

> Hi everyone,
>
> First off, thanks for your work on notmuch2, Floris!
>
> Just to clarify: alot does not, and will not, depend on packages being on PyPI
> and is not intended to be installed through pip. I simply don't want to 
> provide
> support for this.
>
> This said, I don't think it is difficult to automate pypi uploads and it 
> cannot
> hurt to have an "official" release up there instead of several unmaintained
> corpses over the years.
>
> Cheers,
> P
>

Notmuch as a project does not currently distribute any binary packages,
whether for linux distros or for PyPi, or fancy new things like flatpaks
or snaps.  A few of the notmuch developers are also Debian developers,
and also maintain notmuch in Debian. We find it convenient to have the
source for the Debian packaging in the notmuch repos, and maintain it
via the notmuch mail based review process.  Other linux distros like
Arch, Fedora, and OpenSUSE are maintained by people less involved with
upstream development, and they maintain the packaging separately. For
me, Pypi packages fall into the same category as other binary packages
that I don't use. In principle pypi packages could be maintained the
same way Debian packages are. That would require someone knowledgable
about the notmuch build system, and about pypi. 

d




___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] python-cffi: read version from notmuch version file

2020-06-19 Thread David Bremner
Floris Bruynooghe  writes:

> This keeps it in sync with the main notmuch version which is less
> confusing to users.

ah, that's much nicer than what I did for the old bindings. merged.

BTW I noticed something (setuptools?) translates "0.30~rc2" to
"0.30-rc2". I assume that is as intended, and there are some stricter
rules for python module versions. It should only affect pre-release
versions in any case.

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCH] python-cffi: read version from notmuch version file

2020-06-19 Thread Floris Bruynooghe
On Fri 19 Jun 2020 at 07:20 -0300, David Bremner wrote:

> Floris Bruynooghe  writes:
> BTW I noticed something (setuptools?) translates "0.30~rc2" to
> "0.30-rc2". I assume that is as intended, and there are some stricter
> rules for python module versions. It should only affect pre-release
> versions in any case.

Supposedly setuptools uses packaging.version:

   $ python3
   Python 3.8.3 (default, May 14 2020, 11:03:12)
   [GCC 9.3.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import packaging.version
   >>> rc1 = packaging.version.parse('0.30~rc1')
   >>> rc1
   
   >>> rc2 = packaging.version.parse('0.30~rc2')
   >>> maj = packaging.version.parse('0.30')
   >>> maj
   
   >>> rc1 < rc2 < maj
   True

So I think this is ok?  Just for completeness:

   >>> rc1b = packaging.version.parse('0.30-rc1')
   >>> rc1b
   
   >>> rc1b < maj
   True

Apparently PEP440 has the full details of how Python wants to see
version numbers work, but it's too many years ago that I read that
thing ;).  This seems good enough to me.

Cheers,
Floris
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] completion: remove "setup" from the list of possible completions

2020-06-19 Thread Łukasz Stelmach
Having "setup" in the set requires entering three instad of two characters
for "search". Since "setup" is rearly used it makes little sense to have
it in the set and cripple UX for much more frequently used "search".
---
 completion/notmuch-completion.bash | 2 +-
 completion/zsh/_notmuch| 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/completion/notmuch-completion.bash 
b/completion/notmuch-completion.bash
index 15425697..c3654a73 100644
--- a/completion/notmuch-completion.bash
+++ b/completion/notmuch-completion.bash
@@ -579,7 +579,7 @@ _notmuch_tag()
 
 _notmuch()
 {
-local _notmuch_commands="compact config count dump help insert new reply 
restore reindex search address setup show tag emacs-mua"
+local _notmuch_commands="compact config count dump help insert new reply 
restore reindex search address show tag emacs-mua"
 local arg cur prev words cword split
 
 # require bash-completion with _init_completion
diff --git a/completion/zsh/_notmuch b/completion/zsh/_notmuch
index e920f10b..6c0344cc 100644
--- a/completion/zsh/_notmuch
+++ b/completion/zsh/_notmuch
@@ -7,7 +7,6 @@ _notmuch_command() {
   local -a notmuch_commands
   notmuch_commands=(
 'help:display documentation for a subcommand'
-'setup:interactively configure notmuch'
 
 'address:output addresses from matching messages'
 'compact:compact the notmuch database'
-- 
2.26.2

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch