-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugins.py:98: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select. #6514
Comments
Just came to report this after seeing it in some tests of one of my projects. Based on a change I made for plugins in that project, I think that changing xarray/xarray/backends/plugins.py Lines 96 to 99 in d479009
to @functools.lru_cache(maxsize=1)
def list_engines():
try:
entrypoints = entry_points(group="xarray.backends") # Python >= 3.10
except TypeError:
entrypoints = entry_points().get("xarray.backends", ())
return build_engines(entrypoints) will take care of this. Not tested as I don't have access to an older Python environment right now, but I can make a pull request later if this would be a suitable workaround and nobody else does so first. |
@bcbnz please open a PR if you have the time. One suggestion would be to use an explicit version check using |
The Compatibility Note I linked above appears to point out the the |
There's some unfortunate version numbers there. That refers to version 3.6 of the third-party importlib_metadata library, a later version of which was used for the |
What happened?
The plugin interface warns with
DeprecationWarning
in python 3.10.What did you expect to happen?
No warning to be issued.
Minimal Complete Verifiable Example
Relevant log output
Anything else we need to know?
According to the Compatibity note in:
https://docs.python.org/3/library/importlib.metadata.html#entry-points
the new API is
entry_points(group='xarray.backends')
Environment
xarray: 2022.3.0
pandas: 1.4.2
numpy: 1.22.3
scipy: 1.8.0
netCDF4: None
pydap: None
h5netcdf: None
h5py: None
Nio: None
zarr: 2.11.3
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: 1.2.10
cfgrib: None
iris: None
bottleneck: None
dask: 2022.04.1
distributed: 2022.4.1
matplotlib: 3.5.1
cartopy: None
seaborn: None
numbagg: None
fsspec: 2022.3.0
cupy: None
pint: None
sparse: None
setuptools: 62.1.0
pip: 22.0.4
conda: 4.12.0
pytest: 7.1.2
IPython: 8.2.0
sphinx: None
The text was updated successfully, but these errors were encountered: