Deprecate pkg_resource.read_text
Closed this issue · 1 comments
leonlan commented
========================================================================================================== warnings summary ==========================================================================================================
tests/download/test_list_names.py::test_list_names[case0]
/Users/leonlan/Dropbox/cvrplib/vrplib/download/list_names.py:52: DeprecationWarning: read_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
fi = pkg_resource.read_text(__package__, "instance_data.csv")
tests/download/test_list_names.py::test_list_names[case0]
/opt/homebrew/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/importlib/resources/_legacy.py:80: DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
with open_text(package, resource, encoding, errors) as fp:
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
---------- coverage: platform darwin, python 3.11.3-final-0 ----------
Coverage XML written to file coverage.xml
=================================================================================================== 86 passed, 2 warnings in 3.39s ===================================================================================================
leonlan@Leons-Air cvrplib %
leonlan commented
I don't have this warning anymore.