Just running import optree raises FutureWarnings since 0.12.0, which breaks our tests. Warnings are suppressed in default Python REPLs, so you have to run Python with python -W default or python -W error to see it.
The warning happens with OpTree 0.12.0, it doesn't happen with 0.11.0.
Since OpTree is a dependency of Keras, I could imagine this affects others as well.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".venv\Lib\site-packages\optree\__init__.py", line 17, in <module>
from optree import accessor, functools, integration, typing
File ".venv\Lib\site-packages\optree\functools.py", line 24, in <module>
from optree import registry
File ".venv\Lib\site-packages\optree\registry.py", line 738, in <module>
class GetitemKeyPathEntry(KeyPathEntry):
File ".venv\Lib\site-packages\typing_extensions.py", line 2839, in __init_subclass__
warnings.warn(msg, category=category, stacklevel=stacklevel + 1)
FutureWarning: The key path API is deprecated and will be removed in a future version. Please use the accessor API instead.
Required prerequisites
What version of OpTree are you using?
0.12.0
System information
OpTree was installed via
pip install optree==0.12.0
.Problem description
Just running
import optree
raisesFutureWarning
s since 0.12.0, which breaks our tests. Warnings are suppressed in default Python REPLs, so you have to run Python withpython -W default
orpython -W error
to see it.The warning happens with OpTree 0.12.0, it doesn't happen with 0.11.0.
Since OpTree is a dependency of Keras, I could imagine this affects others as well.
Reproducible example code
or (without tracebacks)
Traceback
Expected behavior
No warnings are raised when importing OpTree.
Additional context
No response