importlib-resources deprecation warning at Python 3.11
The following deprecation warning appears whenever running lalpulsar_version
in a Python 3.11 environment
(as reported in this issue).
/home/rodrigo/opt/miniconda3/envs/pyfstat-dev311/bin/lalpulsar_version:5: DeprecationWarning: path is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
This is solely used in wheel/setup.py
and wheel/setup.py.in
as part of a stub
variable:
stub = """
#!python
import os
import sys
from importlib import resources
with resources.path('lalapps', '__init__.py') as new_path:
new_path = str(new_path.parent / 'bin' / '{}')
os.execv(new_path, sys.argv)
""".strip()
I see the developers provided a "drop-in" replacement here, but I'm not qualified to decide what is best.
This is not a problem per se except for the fact that we get some new warnings on PyFstat, but it would be nice if we could have it fixed if it doesn't take too much.
Edited by Rodrigo Tenorio