The python binary that was initially found is used to launch pytest.
It turns out to be surprisingly hard to run 'pytest' in test() with the python
binary detected using meson's python module. test() does not allow the
"program" argument to be a str, which is what python module's .full_path()
returns. So let's "find" the program again. This results in one line of noise
in meson output, but I don't see a nicer way.
'ninja -C build test' works. 'meson test -C build' is better, because it can be
called with '-v' to print details of the test.
systemd headers should be included using <>.
And use a single include of Python.h and define PY_SSIZE_T_CLEAN
before it, so that we're using a consistent API everywhere.
$ ninja -C build update-constants -v
ninja: Entering directory `build'
[1/1] /home/zbyszek/src/python-systemd/update-constants.py /home/zbyszek/src/python-systemd/src/systemd/id128-constants.h /home/zbyszek/src/python-systemd/docs/id128.rst /home/zbyszek/src/python-systemd/src/systemd/id128-defines.h /usr/include/systemd/sd-messages.h
Writing /home/zbyszek/src/python-systemd/src/systemd/id128-constants.h…
Writing /home/zbyszek/src/python-systemd/src/systemd/id128-defines.h…
Writing /home/zbyszek/src/python-systemd/docs/id128.rst…
The helper is updated to do the everything in the python script. The wrapper in
Makefile is dropped. It wasn't working properly anyway, and I think the version
in meson is enough.