Closed machawk1 closed 1 month ago
Per the Python 3.12 release notes, pkg_resources
is no longer installed by default in virtual environments in addition to the absence of distutils
, setuptools
, and easy_install
(see https://github.com/python/cpython/issues/95299). ipwb uses this in testing, particular in test_backends.py
. These can be installed via pip install setuptools
once the venv has been activated.
The testing GH Action reports, "from six.moves.urllib_parse import urlsplit, urlunsplit" only for Python 3.12. six
ought to be removed and its usage adapted to Python 3 built-in modules if possible, as ipwb no longer supports Python 2.
EDIT: see #816 for the above effort.
/Users/runner/work/ipwb/ipwb/ipwb/util.py:27: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
pkg_resources
for Python 3.12 support.parse_version()
within pkg_resources
is the issue here. An alternative to obtain the package version is importlib.metadata import version
but that does not split the version based on sortable keys, as did parse_version()
The main reason for this check was to send a communicate with the IPFS daemon differently if its version was < 0.4.10, which is far from supported by ipwb. Regardless, it is useful to have this logic to check for a supported version of the daemon to ensure commands from ipwb will be processed predictably.
An alternative can be had in the packaging external module.
from packaging.version import parse, Version
parse("1.1.1") < parse("1.2")
Another substitute from replay.py is the need for replacing:
index_file_name = pkg_resources.resource_filename(__name__, index_file_path)
with the equivalent from importlib.resources
We likely don't need to assert the function with assert in the name. That might be the solution to the testing reporting a comparison with None
.
Released October 2, 2023 though its availability in the GitHub Actions test suite is TBD.