DeprecationWarning when running with pytest
Describe the bug
When running a file that does anyconfig.load with pytest, a DeprecationWarning is thrown:
venv/lib/python3.11/site-packages/anyconfig/processors/utils.py:245: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
for res in (eps.get(pgroup, []) if isinstance(eps, dict)
To Reproduce Steps to reproduce the behavior:
- create
test.ymlwith content "test: 123" - create test.py with content
import anyconfig
def test_load():
anyconfig.load("test.yml")
- Run the file with
pytest test.py
Expected behavior No warnings
Desktop (please complete the following information):
- Version 0.14.0
Additional context The deprecation warning seems to come from importlib_metadata, see: https://github.com/python/importlib_metadata/issues/298
@SimonDR-Boltzmann Thanks for your report!
Currently, anyconfig supports python 3.9 and importlib.metadata for python 3.9 does not seem to support that 'select' interface yet. So I cannot remove the code causing that warning until I drop its python 3.9 support.
python-anyconfig.git on next [$?] via 🐍 v3.9.23 (py39)
✦ ❯ ./.tox/py39/bin/python3.9
Python 3.9.23 (main, Jun 4 2025, 00:00:00)
[GCC 15.1.1 20250521 (Red Hat 15.1.1-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import importlib.metadata; eps = importlib.metadata.entry_points()
>>> eps.select
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'dict' object has no attribute 'select'
>>> isinstance(eps, dict)
True
>>>
Ah, I see. That makes sense, thank you for the explanation. Feel free to close this issue again then (unless you feel suppressing the warning until 3.9 is dropped would be worthwhile).
I'll keep this to remember working on this later.
Anyway, thanks a lot for your report!