#1013754 python-h5netcdf: FTBFS with NetCDF 4.9.0 (test failures)

Package:
src:python-h5netcdf
Source:
python-h5netcdf
Submitter:
Bas Couwenberg
Date:
2022-06-27 09:39:03 UTC
Severity:
serious
Tags:
#1013754#5
Date:
2022-06-25 12:30:45 UTC
From:
To:
Dear Maintainer,

Your package FTBFS with NetCDF 4.9.0 which added more compression options, this also causes the autopkgtest to fail:

=================================== FAILURES ===================================

tests/test_h5netcdf.py:450:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_h5netcdf.py:446: in roundtrip_legacy_netcdf
    read_legacy_netcdf(tmp_netcdf, read_module, write_module)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

tmp_netcdf = '/tmp/pytest-of-debci/pytest-0/test_write_legacyapi_read_netC0/testfile.nc'
read_module = <module 'netCDF4' from '/usr/lib/python3/dist-packages/netCDF4/__init__.py'>
write_module = <module 'h5netcdf.legacyapi' from '/usr/lib/python3/dist-packages/h5netcdf/legacyapi.py'>

    def read_legacy_netcdf(tmp_netcdf, read_module, write_module):
        ds = read_module.Dataset(tmp_netcdf, "r")
        assert ds.ncattrs() == ["global", "other_attr"]
        assert ds.getncattr("global") == 42
        if write_module is not netCDF4:
            # skip for now: https://github.com/Unidata/netcdf4-python/issues/388
            assert ds.other_attr == "yes"
        with pytest.raises(AttributeError):
            ds.does_not_exist
        assert set(ds.dimensions) == set(
            ["x", "y", "z", "empty", "string3", "mismatched_dim", "unlimited"]
        )
        assert set(ds.variables) == set(
            [
                "foo",
                "y",
                "z",
                "intscalar",
                "scalar",
                "var_len_str",
                "mismatched_dim",
                "foo_unlimited",
            ]
        )

        assert set(ds.groups) == set(["subgroup"])
        assert ds.parent is None
        v = ds.variables["foo"]
        assert array_equal(v, np.ones((4, 5)))
        assert v.dtype == float
        assert v.dimensions == ("x", "y")
        assert v.ndim == 2
        assert v.ncattrs() == ["units"]
        if write_module is not netCDF4:
            assert v.getncattr("units") == "meters"
        assert tuple(v.chunking()) == (4, 5)
            "complevel": 4,
            "fletcher32": False,
            "shuffle": True,
            "zlib": True,
        }
E       AssertionError: assert {'blosc': Fal...': False, ...} == {'complevel':... 'zlib': True}
E         Omitting 4 identical items, use -vv to show
E         Left contains 4 more items:
E         {'blosc': False, 'bzip2': False, 'szip': False, 'zstd': False}
E         Use -v to get the full diff

tests/test_h5netcdf.py:259: AssertionError


tests/test_h5netcdf.py:468:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

tmp_netcdf = '/tmp/pytest-of-debci/pytest-0/test_write_h5netcdf_read_netCD0/testfile.nc'
read_module = <module 'netCDF4' from '/usr/lib/python3/dist-packages/netCDF4/__init__.py'>
write_module = <module 'h5netcdf' from '/usr/lib/python3/dist-packages/h5netcdf/__init__.py'>

    def read_legacy_netcdf(tmp_netcdf, read_module, write_module):
        ds = read_module.Dataset(tmp_netcdf, "r")
        assert ds.ncattrs() == ["global", "other_attr"]
        assert ds.getncattr("global") == 42
        if write_module is not netCDF4:
            # skip for now: https://github.com/Unidata/netcdf4-python/issues/388
            assert ds.other_attr == "yes"
        with pytest.raises(AttributeError):
            ds.does_not_exist
        assert set(ds.dimensions) == set(
            ["x", "y", "z", "empty", "string3", "mismatched_dim", "unlimited"]
        )
        assert set(ds.variables) == set(
            [
                "foo",
                "y",
                "z",
                "intscalar",
                "scalar",
                "var_len_str",
                "mismatched_dim",
                "foo_unlimited",
            ]
        )

        assert set(ds.groups) == set(["subgroup"])
        assert ds.parent is None
        v = ds.variables["foo"]
        assert array_equal(v, np.ones((4, 5)))
        assert v.dtype == float
        assert v.dimensions == ("x", "y")
        assert v.ndim == 2
        assert v.ncattrs() == ["units"]
        if write_module is not netCDF4:
            assert v.getncattr("units") == "meters"
        assert tuple(v.chunking()) == (4, 5)
            "complevel": 4,
            "fletcher32": False,
            "shuffle": True,
            "zlib": True,
        }
E       AssertionError: assert {'blosc': Fal...': False, ...} == {'complevel':... 'zlib': True}
E         Omitting 4 identical items, use -vv to show
E         Left contains 4 more items:
E         {'blosc': False, 'bzip2': False, 'szip': False, 'zstd': False}
E         Use -v to get the full diff

tests/test_h5netcdf.py:259: AssertionError
=========================== short test summary info ============================
FAILED tests/test_h5netcdf.py::test_write_legacyapi_read_netCDF4 - AssertionE...
FAILED tests/test_h5netcdf.py::test_write_h5netcdf_read_netCDF4 - AssertionEr...
=================== 2 failed, 69 passed, 22 skipped in 2.44s ===================


The attached patch fixes the issue.

Kind Regards,

Bas

#1013754#12
Date:
2022-06-27 07:46:40 UTC
From:
To:
Control: tags -1 fixed-upstream

Upstream has published a new release with a fix for this issue:

"
  h5netcdf patch release 1.0.1 is available on PyPI now.
"

Kind Regards,

Bas

#1013754#19
Date:
2022-06-27 09:34:11 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
python-h5netcdf, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1013754@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Bas Couwenberg <sebastic@debian.org> (supplier of updated python-h5netcdf package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Mon, 27 Jun 2022 10:44:56 +0200
Source: python-h5netcdf
Architecture: source
Version: 1.0.1-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Science Maintainers <debian-science-maintainers@lists.alioth.debian.org>
Changed-By: Bas Couwenberg <sebastic@debian.org>
Closes: 1013754
Changes:
 python-h5netcdf (1.0.1-1) unstable; urgency=medium
 .
   * Team upload.
 .
   [ Debian Janitor ]
   * Trim trailing whitespace.
   * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository,
     Repository-Browse.
   * Remove constraints unnecessary since buster:
     + Build-Depends: Drop versioned constraint on dpkg-dev.
 .
   [ Bas Couwenberg ]
   * New upstream release.
     (closes: #1013754)
   * Add patch to not use setuptools_scm to regenerate _version.py.
   * Use doc section for python-h5netcdf-doc.
   * Bump Standards-Version to 4.6.1, no changes.
   * Update lintian overrides.
Checksums-Sha1:
 034f61ae8e1606659364ad30a4c7be9c08de4afb 2405 python-h5netcdf_1.0.1-1.dsc
 9286d215fa5efcbb954788af00f68b28a4b6540d 53055 python-h5netcdf_1.0.1.orig.tar.gz
 0d1847164be183ddfa899db71e735005336335a2 4580 python-h5netcdf_1.0.1-1.debian.tar.xz
 714fdebec6e919cfe140022789c3b2feaee72de1 10624 python-h5netcdf_1.0.1-1_amd64.buildinfo
Checksums-Sha256:
 4dcea7495c4656fe6aad021641829c2e90787006abb243788f72fbc5cba0ae24 2405 python-h5netcdf_1.0.1-1.dsc
 776704facd8b82246d6d4068c505c389b3b70b9bf9920ccfbac7f35cdc634dac 53055 python-h5netcdf_1.0.1.orig.tar.gz
 c55f2ec525d73b16226fc00b0c042eb269fe84ae7b5bc399eb5d04b96c65a635 4580 python-h5netcdf_1.0.1-1.debian.tar.xz
 e8903e96d64ba19efe6969bc9bdcd4d73796c063b002f1b465788a7e8a62352f 10624 python-h5netcdf_1.0.1-1_amd64.buildinfo
Files:
 915f89683bd7f9ef7f07f8d5a98126fe 2405 python optional python-h5netcdf_1.0.1-1.dsc
 e709546d79c3c1ceba75dc5449414f8b 53055 python optional python-h5netcdf_1.0.1.orig.tar.gz
 b8d439ab7b4212b3c2317e37917ed999 4580 python optional python-h5netcdf_1.0.1-1.debian.tar.xz
 f1887bba303c19de1eb058046a3dc236 10624 python optional python-h5netcdf_1.0.1-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEgYLeQXBWQI1hRlDRZ1DxCuiNSvEFAmK5dcAACgkQZ1DxCuiN
SvFpnhAAl4fX76CN4P6/0OybGOlj7VDrkMx6RtIS7pUZd+1+ZxcaQ1OIw+k4p5vy
CVcoZ6WVNN0PmOFhuk1FKwmcPg2ln0FydHFlrvdMtcaLsgqc6ix1O3Nkm9OOqm2r
zrh72VBvUu1SlIMbYzmDaCuXv8zaS50ukKFzC5ddApJFAHlhroiJGFvHzHkOcWEw
aF5gIu81zm1N7tMB7U5aUXpH45fLkFmKZtT5mVWT6zCil9YEvUJZ0wzFtGEsE79L
GYROXaO+4O/Pz915dDkeSR9vus9Lhm2DI7/FopdkkanezknnfAnAe3Uy9XYwsz7l
O8cZfKRldGxhYBqipY4X+8rnVhgQtBJuGkhpdDG+lL+4gOeRlOSw76jSelSBa59P
Sk2AorxKCppjl7uE/44D15RgwsX6mFetjthnraK0novVPnZIuEN7fhvUL00Vi9AQ
LgXsa9ezqHFx6/a8PnE6pV+kMGXbzErdFQotQ8Ih+cEIMheMHX7b7y6kj8QAsQ0N
W6bWeTHLW1ADl3E2DjL6Xk/pLe3DopjIXTqUUJ+jhBvk/vgxg3bWojeZdqiB7VJ+
OkkGsb5Fr3Nr5fZoM+1KAdgZ9sJ543uZ47DwFazG0JB+1YrTTwJK+l/yaOkRmgwN
U4JZMSsoXmlvyOoPbAakTO+kJHw4OSUwLrxg/c9MXhvESeYinA8=
=f1e5
-----END PGP SIGNATURE-----