Re: [PATCH 2/2] bindings/python-cffi: update version from global version.

Subject: Re: [PATCH 2/2] bindings/python-cffi: update version from global version.

Date: Thu, 25 Jun 2020 10:34:12 -0300

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


David Bremner <david@tethera.net> writes:

> Copy machinery from the older python bindings

>  
> +# get the notmuch version number without importing the notmuch module
> +version_file = os.path.join(os.path.dirname(__file__),
> +                            'notmuch2', 'version.py')
> +exec(compile(open(version_file).read(), version_file, 'exec'))
> +assert '__VERSION__' in globals(), \
> +    'Failed to read the notmuch binding version number'

I wrote a cover letter for this, but that seems to have gotten lost. My
main point was I'm not sure why this is better than Floris's version,
since they both read a file when setup.py is run. I don't understand (or
use) pip, so someone else will have to figure this out. If the
constraint is that the version has to be hardcoded in setup.py then (as
much as that sounds like a design mistake), we can apply similar sed
hackery directly to setup.py. Perhaps someone can remember why we didn't
do that for the old python bindings.

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

Thread: