darshan-hpc / darshan

Darshan I/O characterization tool
Other
57 stars 28 forks source link

Some importlib.resources deprecation warnings #928

Open tylerjereddy opened 1 year ago

tylerjereddy commented 1 year ago

Visible in testsuite locally with Python 3.11, haven't yet checked if we can easily migrate with our extended Python version support requirements/shims.

tests/test_summary.py: 16 warnings
  /Users/treddy/github_projects/darshan/darshan-util/pydarshan/darshan/cli/summary.py:274: DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    with importlib_resources.path(darshan.cli, "style.css") as path:

tests/test_summary.py::test_main_without_args[argv0-3-3]
tests/test_summary.py::test_main_with_args[argv1]
tests/test_summary.py::test_main_with_args[argv0]
tests/test_summary.py::test_main_without_args[argv5-12-8]
tests/test_summary.py::test_main_without_args[argv1-3-3]
tests/test_summary.py::test_main_without_args[argv2-9-6]
tests/test_summary.py::test_main_without_args[argv3-9-6]
  /Users/treddy/github_projects/darshan/darshan-util/pydarshan/darshan/cli/summary.py:654: DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
    with importlib_resources.path(darshan.cli, "base.html") as base_path:

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
tylerjereddy commented 1 year ago

We'd probably need to use the third-party library importlib_resources until Python 3.9 is our minimum supported version. It probably should already be the case per NEP 29, but anyway..