Re: [PATCH] test: do not add legacy bindings to PYTHONPATH

Subject: Re: [PATCH] test: do not add legacy bindings to PYTHONPATH

Date: Mon, 23 Jun 2025 12:28:04 +0200

To: Tomi Ollila

Cc: notmuch@notmuchmail.org

From: Michael J Gruber


Am Mo., 23. Juni 2025 um 12:05 Uhr schrieb Tomi Ollila <tomi.ollila@iki.fi>:
>
> On Fri, Jun 20 2025, michaeljgruber wrote:
>
> > From: Michael J Gruber <git@grubix.eu>
> >
> > d526797a ("python: move legacy python bindings to contrib.", 2025-02-15)
> > moved the legacy python bindings away from the location in `bindingss/`.
> > Do not add that location to the PYTHONPATH since it is obsolete.
>
> If tests still work then this is GOOD :D

Tested and passed :)

Indeed, this is a clean-up precursor to my PEP 517 endeavour. `python
setup.py build` etc have been deprecated for a "while" now, and Fedora
has a proposal to pull the plug. I can build and install notmuch
bindings using `python -m build` and `pip` already (using the existing
setup.py as a mere "config file"). This uses wheels, and now I"m looking
for the least intrusive change which allows us to run the tests without
installing (most probably by installing from the wheel into a stage
directory - tested and works locally already).

Over in Fedora packaging, we'd want to separate build steps for the
python module from the rest, and (possibly) run the tests against the
installed module. So that spot in test-lib.sh might see another
suggested change in the future, and that one will be clearer if it is
clean-up first, which should be a good step independent of my
not-any-more-secret agenda.

Michael

> Tomi
>
> > ---
> >  test/test-lib.sh | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/test/test-lib.sh b/test/test-lib.sh
> > index 059e110c..5b3cd454 100644
> > --- a/test/test-lib.sh
> > +++ b/test/test-lib.sh
> > @@ -896,7 +896,7 @@ test_done () {
> >  test_python () {
> >      # Note: if there is need to print debug information from python program,
> >      # use stdout = os.fdopen(6, 'w') or stderr = os.fdopen(7, 'w')
> > -    PYTHONPATH="$NOTMUCH_BUILDDIR/bindings/python-cffi/build/stage:$NOTMUCH_SRCDIR/bindings/python${PYTHONPATH:+:$PYTHONPATH}" \
> > +    PYTHONPATH="$NOTMUCH_BUILDDIR/bindings/python-cffi/build/stage${PYTHONPATH:+:$PYTHONPATH}" \
> >       $NOTMUCH_PYTHON -B - > OUTPUT
> >  }
> >
> > --
> > 2.50.0.135.g8da7ba24c6
> >
> > _______________________________________________
> > notmuch mailing list -- notmuch@notmuchmail.org
> > To unsubscribe send an email to notmuch-leave@notmuchmail.org
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: