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

Fix DeprecationWarning filter #174

Merged
merged 1 commit into from
Apr 2, 2023
Merged

Conversation

benallard
Copy link
Contributor

Somehow, the filter based on the package name did not worked for me.

Somehow, the filter based on the package name did not worked for me.
@vmagamedov
Copy link
Owner

Can you show warnings you get in your environment? I'm getting only ResourceWarning in mine environment.

@benallard
Copy link
Contributor Author

Sure, that's the errors I'm having.

===================================================== test session starts ======================================================
platform linux -- Python 3.10.10, pytest-7.2.2, pluggy-1.0.0
rootdir: /home/ben/aur/python-grpclib/src/grpclib-0.4.3, configfile: setup.cfg, testpaths: tests
plugins: cov-4.0.0, mock-3.10.0, Faker-16.8.0, asyncio-0.21.0
asyncio: mode=auto
collected 196 items / 3 errors

============================================================ ERRORS ============================================================
_________________________________________ ERROR collecting tests/test_client_events.py _________________________________________
Traceback (most recent call last):
  File "/home/ben/aur/python-grpclib/src/grpclib-0.4.3/tests/test_client_events.py", line 6, in <module>
    from google.rpc.error_details_pb2 import ResourceInfo
  File "/usr/lib/python3.10/site-packages/google/rpc/__init__.py", line 18, in <module>
    import pkg_resources
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 121, in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
DeprecationWarning: pkg_resources is deprecated as an API
_________________________________________ ERROR collecting tests/test_server_events.py _________________________________________
Traceback (most recent call last):
  File "/home/ben/aur/python-grpclib/src/grpclib-0.4.3/tests/test_server_events.py", line 4, in <module>
    from google.rpc.error_details_pb2 import ResourceInfo
  File "/usr/lib/python3.10/site-packages/google/rpc/__init__.py", line 18, in <module>
    import pkg_resources
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 121, in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
DeprecationWarning: pkg_resources is deprecated as an API
_____________________________________ ERROR collecting tests/test_status_details_codec.py ______________________________________
Traceback (most recent call last):
  File "/home/ben/aur/python-grpclib/src/grpclib-0.4.3/tests/test_status_details_codec.py", line 3, in <module>
    from google.rpc.error_details_pb2 import Help
  File "/usr/lib/python3.10/site-packages/google/rpc/__init__.py", line 18, in <module>
    import pkg_resources
  File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 121, in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
DeprecationWarning: pkg_resources is deprecated as an API
=================================================== short test summary info ====================================================
ERROR tests/test_client_events.py - DeprecationWarning: pkg_resources is deprecated as an API
ERROR tests/test_server_events.py - DeprecationWarning: pkg_resources is deprecated as an API
ERROR tests/test_status_details_codec.py - DeprecationWarning: pkg_resources is deprecated as an API
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================================== 3 errors in 1.15s =======================================================

@vmagamedov vmagamedov merged commit ff9d555 into vmagamedov:master Apr 2, 2023
@vmagamedov
Copy link
Owner

Thanks! This temporarily fixes googleapis/python-api-common-protos#140

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 this pull request may close these issues.

2 participants