nagiosplugin icon indicating copy to clipboard operation
nagiosplugin copied to clipboard

test_examples.py:2: DeprecationWarning: pkg_resources is deprecated as an API

Open sbraz opened this issue 1 year ago • 1 comments

Hi, It looks like setuptools will eventually remove pkg_resources so the following will fail: https://github.com/mpounsett/nagiosplugin/blob/050651a39c3ad986367bf93d817fa62a47c15de2/tests/test_examples.py#L19

Running the test suite results in:

tests/test_examples.py:2                                                                                                                                                                                           
  /var/tmp/portage/dev-python/nagiosplugin-1.3.3/work/nagiosplugin-1.3.3/tests/test_examples.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resource
s.html                                                                                                                                                                                                             
    import pkg_resources                                                                                                                                                                                           

There is documentation here that explains how to migrate to importlib.resources: https://importlib-resources.readthedocs.io/en/latest/migration.html#pkg-resources-resource-filename

sbraz avatar Jun 02 '24 03:06 sbraz

Thanks. I'll have a look at that. I need to migrate everything to more modern packaging for 3.12 anyway, I think.

mpounsett avatar Jul 20 '24 20:07 mpounsett