pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.34k stars 638 forks source link

Python upgrade deprecation warnings #21673

Open tdyas opened 1 day ago

tdyas commented 1 day ago

Some deprecation warnings seen with the Python 3.11 upgrade in Pants sources:

src/python/pants/backend/python/subsystems/python_tool_base.py:228: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  lock_bytes = importlib.resources.read_binary(parts.netloc, lockfile_path)
src/python/pants/jvm/resolve/coursier_fetch.py:783: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  lockfile_bytes = importlib.resources.read_binary(
src/python/pants/backend/python/util_rules/pex_requirements.py:213: DeprecationWarning: read_binary is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
  importlib.resources.read_binary(parts.netloc, lockfile_path),
tdyas commented 1 day ago

cc @cburroughs