Python-Cardano / pycardano

A lightweight Cardano library in Python
https://pycardano.readthedocs.io
MIT License
213 stars 65 forks source link

Testing with Pycardano will fail in Python 3.12.0 (possibly use) #366

Open ross-spencer opened 1 month ago

ross-spencer commented 1 month ago

Describe the bug

Pycardano failing 3.12.0 tests because of Blockfrost import.

To Reproduce

Try to test a feature requiring import of Pyardano in Python 3.12, the test will fail because 3.12.0 cannot import module pkg_resources via Blockfrost-Python.

Logs

On 3.10 we were already seeing deprecation warnings:

.tox/py3/lib/python3.10/site-packages/blockfrost/config.py:2
  /home/ross-spencer/git/orcfax/simple_sign/.tox/py3/lib/python3.10/site-packages/blockfrost/config.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

On 3.12:

.tox/py3/lib/python3.12/site-packages/blockfrost/config.py:2: in <module>
    import pkg_resources
E   ModuleNotFoundError: No module named 'pkg_resources'

Expected behavior

I'm not sure if this library is expected to work in 3.12.0 yet but it'd be great if it did.

Environment and software version (please complete the following information):

Additional context

Blockfrost hasn't been updated in this library since 0.5.3 - blockfrost is now on 0.6.0 and the dependency on pkg_resources has been removed, ref: https://github.com/blockfrost/blockfrost-python/commit/add8f5be08426da3e9b136eeea5c04f13aaace4c

ross-spencer commented 1 month ago

Connected to: https://github.com/blockfrost/blockfrost-python/issues/41

cffls commented 1 month ago

Thanks. I will update the dependency as soon as blockfrost releases the new version.

ross-spencer commented 3 weeks ago

@cffls blockfrost-python just pushed 6.0.0: https://pypi.org/project/blockfrost-python/0.6.0/