[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#807432: RFS: python-jellyfish/0.5.1-1 [ITP]



Hello Nicholas,

> I believe the package also needs Build-Depends on libpython-all-dev and
> libpython3-all-dev, or the C extensions fail (nonfatally) to compile in a clean
> chroot environment.

thanks for the hint - the Build-Depends are indeed needed for successfully
building the C extensions, my apologies for the oversight. I'll make sure to
use a clean chroot for building in the future.

> Unfortunately, the tests also fail - it appears that pytest is not successfully
> picking up any tests to run:

thanks as well for pointing it out. It seems that upstream is not strictly
following the standard pytest naming convention for test files, and relying
instead of on some setup.py magic for running the unit tests. I have appended
the following lines to debian/rules, pointing pytest to the right file and
making the testdata .csv files available during testing:

export PYBUILD_BEFORE_TEST = cp -R {dir}/testdata {build_dir}
export PYBUILD_AFTER_TEST = rm -R {build_dir}/testdata
export PYBUILD_TEST_ARGS = jellyfish/test.py

This seemed a bit less intrusive than renaming the jellyfish/test.py file. The
package on mentors and the temporary CVS repository [1] have been updated with
these two changes, as well as including a README.Debian file with some
clarifications about the naming after some discussion at [2].

Additionally, I noticed that the tests result in an error if using the pytest
version at Debian jessie (2.6.3-2):

==================================== ERRORS ====================================
______________________ ERROR collecting jellyfish/test.py ______________________
/usr/lib/python3/dist-packages/_pytest/runner.py:139: in __init__
    self.result = func()
...
/usr/lib/python3/dist-packages/_pytest/python.py:824: in parametrize
    if ids and len(ids) != len(argvalues):
E   TypeError: object of type 'type' has no len()
=========================== 1 error in 0.08 seconds ============================

but they do pass using the pytest version at stretch and above. The culprit
seems to be the usage of the "ids" parameter of the parametrize decorator,
which is set to the built-in "str" on a handful of cases:

jellyfish/test.py:38
@pytest.mark.parametrize("s1,s2,value", _load_data('jaro_winkler'), ids=str)

Older versions of pytest seem to require that the "ids" parameters is strictly
a list or None, not handling callables properly.

I'm wondering what would be the recommended way to deal with situation: would
simply modifying the pytest build-depend so it requires a specific version or
above suffice (even if it might make testing on a stable chroot impossible)?
After some light inspection, it seems that this could probably be solved as
well by a patch that replaces "str" with a valid value (or drops it), and I'd
be happy to follow that path as well, or further inspect the situation.

Again, thanks a look for your insights and taking a look at the package!

[1] https://github.com/diego-plan9/python-jellyfish-mentors
[2] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=806716#12

-- 
Diego M. Rodriguez
36B3 42A9 9F2F 2CFB F79B  FF9B B6C4 B901 06BC E232

Attachment: signature.asc
Description: Digital signature


Reply to: