Skip to content

Commit

Permalink
Remove an import fallback (#8228)
Browse files Browse the repository at this point in the history
  • Loading branch information
max-sixty authored Sep 23, 2023
1 parent cdf0726 commit 24bf804
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ module = [
"fsspec.*",
"h5netcdf.*",
"h5py.*",
"importlib_metadata.*",
"iris.*",
"matplotlib.*",
"mpl_toolkits.*",
Expand Down
8 changes: 2 additions & 6 deletions xarray/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from importlib.metadata import version as _version

from xarray import testing, tutorial
from xarray.backends.api import (
load_dataarray,
Expand Down Expand Up @@ -41,12 +43,6 @@
from xarray.core.variable import IndexVariable, Variable, as_variable
from xarray.util.print_versions import show_versions

try:
from importlib.metadata import version as _version
except ImportError:
# if the fallback library is missing, we are doomed.
from importlib_metadata import version as _version

try:
__version__ = _version("xarray")
except Exception:
Expand Down

0 comments on commit 24bf804

Please sign in to comment.