Skip to content

DeprecationWarning: pkg_resources is deprecated as an API #242

@MrNaif2018

Description

@MrNaif2018

What happened?

Running in CI with warnings enabled, eth_utils import fails the tests because it uses pkg_resources.

Code that produced the error

from eth_utils import decode_hex

Full error output

tests/test_query.py:3: in <module>
    from tronpy import AsyncTron, Tron
tronpy/__init__.py:1: in <module>
    from tronpy.async_contract import AsyncContract
tronpy/async_contract.py:5: in <module>
    from tronpy.contract import Contract, ContractFunctions, ContractMethod, ShieldedTRC20
tronpy/contract.py:5: in <module>
    from eth_utils import decode_hex
../venv/lib/python3.8/site-packages/eth_utils/__init__.py:1: in <module>
    import pkg_resources
../venv/lib/python3.8/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

Fill this section in if you know how this could or should be fixed

https://setuptools.pypa.io/en/latest/pkg_resources.html
importlib.resources and similar should be used instead

eth-utils Version

2.1.1

Python Version

3.8

Operating System

linux

Output from pip freeze

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions