unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Floris Bruynooghe <flub@devork.be>
To: Frank LENORMAND <lenormf.ml@gmail.com>, notmuch@notmuchmail.org
Subject: Re: [PATCH] python-cffi: read version from notmuch version file
Date: Mon, 22 Jun 2020 23:45:01 +0200	[thread overview]
Message-ID: <87sgemdbc2.fsf@powell.devork.be> (raw)
In-Reply-To: <159256957312.2284556.9348455868725621819@localhost.localdomain>

On Fri 19 Jun 2020 at 15:26 +0300, Frank LENORMAND wrote:

> On Fri Jun 19 12:46:28 2020, Floris Bruynooghe wrote:
>> 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='flub@devork.be',
>> -- 
>> 2.27.0
>
> It seems that this strategy doesn't work well when the user runs
> `pip install .` in the `bindings/python-cffi` directory.
>
> Apparently all the files are copied to a temporary directory first:
>
> https://travis-ci.com/github/pazz/alot/jobs/351377760#L708-L710
>
> It doesn't happen with the original bindings, probably because the version
> number is stored in `bindings/python/notmuch/version.py`, which is also
> copied when `pip` runs.

Ouch, I only tested pip install -e, which does work.  But indeed a plain
pip install no longer works which is pretty bad.

I guess we could either revert this and do the same sed hackery as the
other bindings, or copy the version file into bindings/python-cffi and
have it loaded in the same way as now.  It would still have to be kept
in sync there sadly.

  reply	other threads:[~2020-06-22 21:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-19  9:46 python-cffi: read version number from notmuch Floris Bruynooghe
2020-06-19  9:46 ` [PATCH] python-cffi: read version from notmuch version file Floris Bruynooghe
2020-06-19 10:20   ` David Bremner
2020-06-19 10:50     ` Floris Bruynooghe
2020-06-19 12:26   ` Frank LENORMAND
2020-06-22 21:45     ` Floris Bruynooghe [this message]
2020-06-23  5:24       ` Frank LENORMAND
2020-06-23  9:33         ` David Bremner
2020-06-23 10:43           ` Frank LENORMAND
2020-06-23 21:16             ` Floris Bruynooghe
2020-06-24  6:29               ` Frank LENORMAND

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgemdbc2.fsf@powell.devork.be \
    --to=flub@devork.be \
    --cc=lenormf.ml@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).