Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.devel > #111732
| From | John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> |
|---|---|
| Newsgroups | linux.debian.devel |
| Subject | Running pybuild tests with search path for entry_points() |
| Date | 2024-05-11 20:50 +0200 |
| Message-ID | <ICZXb-cFfw-5@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
(Please CC me as I'm not subscribed to debian-devel)
Hello,
I am currently trying to update src:kiwi to its latest upstream version to fix
#1069389 [1].
The problem that I am now stuck with is that the testsuite uses the entry_points
class to test for the available kiwi.tasks. It looks like something like this:
from importlib_metadata import entry_points
for entry in dict.get(entry_points(), 'kiwi.tasks'):
discovered_tasks[entry.name] = entry.load()
However, that fails because the kiwi module needs to be either installed for
entry_points() to find "kiwi.tasks" or the PYTHONPATH needs to include the
build directory below ".pybuild". Otherwise, entry_points() will not include
"kiwi.tasks" and the testsuite fails.
I noticed that entry_points() will also work as expected if the python interpretor
is run from within the build directory below ".pybuild", so I tried adding the
following to debian/rules according to [2]:
export PYTHONPATH = $(CURDIR)
export PYBUILD_TEST_ARGS_python3 = cd {build_dir}; python{version} -m discover
That doesn't work unfortunately and entry_points() still fails and there doesn't
seem to be much documentation available for pybuild which explains how to adjust
PYTHONPATH for running the testuite.
Note that I tried this with kiwi 10.0.16 plus the patch from [3]. I put up a little
reproducer in [4].
Does anyone know how to make pybuild set the proper PYTHONPATH so that entry_points()
works while running the testsuite?
Thanks,
Adrian
> [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069389
> [2] https://wiki.debian.org/Python/Pybuild
> [3] https://github.com/OSInside/kiwi/pull/2550
> [4] https://github.com/OSInside/kiwi/issues/2548#issuecomment-2103993758
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Back to linux.debian.devel | Previous | Next | Find similar | Unroll thread
Running pybuild tests with search path for entry_points() John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> - 2024-05-11 20:50 +0200
csiph-web