Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sbraz opened this issue Jun 2, 2024 · 1 comment
Assignees
Labels
bug Something isn't working minor

Comments

@sbraz
Copy link
Contributor

sbraz commented Jun 2, 2024

Hi,
It looks like setuptools will eventually remove pkg_resources so the following will fail:

sys.executable, pkg_resources.resource_filename(

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

@mpounsett
Copy link
Owner

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

@mpounsett mpounsett self-assigned this Jul 20, 2024
@mpounsett mpounsett added bug Something isn't working minor labels Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working minor
Projects
None yet
Development

No branches or pull requests

2 participants