On Thu, 18 Jun 2020, Shayan Doust wrote:

I have been having some issues with packaging intake[1] for the Debian
Med packaging team, specifically during pytest. There are a lot of tests
failing, so I contacted upstream for a solution.

According to upstream, the "entrypoints in the setup script are not
being registered when using python3 setup.py build", so I decided to do
some experimentation. It seems like the entry_points do actually get
registered and installed, so I experimentally overrode dh_auto_test and
only triggered dh_auto_test after dh_install (which is also overridden).
Unfortunately, this has not made any difference and a good hundred unit
tests fail.

I am new to Python packaging, especially one that features entry points.
If anyone could please kindly look into the package (and possibly even
building it), this would be much appreciated.

Kind regards,
Shayan Doust

[1]: https://salsa.debian.org/med-team/intake

Yes, this is unfortunately a common packaging problem due to the test target running before the install target which causes problems for a lot of Python packages that do additional work during the install step.

Anyway, you can fix most of the failures by creating a
debian/pybuild.testfiles file that contains:

This causes the egg-info to be copied into the directory used for testing. This solves the errors related to plugins but not the ones related to console scripts, since the console script shims don't get created until 'install' runs. :(

For the console scripts, I don't have any good ideas other than overriding dh_auto_test and dh_auto_install (so that you run dh_auto_test *after* dh_auto_install). But you will probably have to set PATH and PYTHONPATH to include the install directories so that the console scripts and Python modules can be found.

Maybe someone else will have a better idea.


Reply via email to