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

[Bug]: DeprecationWarning: pkg_resources is deprecated as an API on =pynwb-2.3.1 #1677

Closed
3 tasks done
TheChymera opened this issue Mar 24, 2023 · 3 comments · Fixed by #1678
Closed
3 tasks done

[Bug]: DeprecationWarning: pkg_resources is deprecated as an API on =pynwb-2.3.1 #1677

TheChymera opened this issue Mar 24, 2023 · 3 comments · Fixed by #1678

Comments

@TheChymera
Copy link

What happened?

The latest pynwb gives a deprecation warning, which in DANDI is elevated to an error, making all tests which rely on pynwb fail.

Steps to Reproduce

(dev) [deco]~/src/dandi-clipytest -vvs dandi/cli/tests/test_cmd_validate.py::test_process_issues
ImportError while loading conftest '/home/chymera/src/dandi-cli/dandi/conftest.py'.
dandi/conftest.py:7: in <module>
    from .tests.fixtures import *  # noqa: F401, F403  # lgtm [py/polluting-import]
dandi/tests/fixtures.py:20: in <module>
    import pynwb
/usr/lib/python3.10/site-packages/pynwb/__init__.py:105: in <module>
    __resources = __get_resources()
/usr/lib/python3.10/site-packages/pynwb/__init__.py:25: in __get_resources
    from pkg_resources import resource_filename
/usr/lib/python3.10/site-packages/pkg_resources/__init__.py:121: in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
E   DeprecationWarning: pkg_resources is deprecated as an API
(dev) [deco]~/src/dandi-clieix pynwb
[?] dev-python/pynwb [1]
     Available versions:  (~)2.1.0-r2^t (~)2.2.0-r1^t {test PYTHON_TARGETS="python3_10"}
     Installed versions:  2.3.1(15:37:18 22/03/23)(test PYTHON_TARGETS="python3_10")
     Homepage:            https://github.com/NeurodataWithoutBorders/pynwb
     Description:         A Python API for working with Neurodata stored in the NWB Format

[1] "science" /home/chymera/src/sci
(dev) [deco]~/src/dandi-clipython
Python 3.10.10 (main, Mar 20 2023, 10:28:47) [GCC 12.2.1 20230304] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pynwb
>>> pynwb.__version__
'2.3.1'

Traceback

No response

Operating System

Linux

Python Executable

Python

Python Version

3.10

Package Versions

No response

Code of Conduct

@bendichter
Copy link
Contributor

Thanks for the issue, but I think elevating warnings to errors is a bit strict

@rly
Copy link
Contributor

rly commented Mar 24, 2023

This seems similar to hdmf-dev/hdmf#826 . We'll issue a fix.

@TheChymera
Copy link
Author

The linked commit indeed fixed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants