From ad46b8e201618211f1ce9fedd260dafed52a1f1d Mon Sep 17 00:00:00 2001 From: Martin Lang Date: Fri, 6 Oct 2023 10:03:45 +0200 Subject: [PATCH] chore: switch from deprecated pkg_resources to importlib.metadata --- discretisedfield/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discretisedfield/__init__.py b/discretisedfield/__init__.py index 92f3793c1..38ebf6e40 100644 --- a/discretisedfield/__init__.py +++ b/discretisedfield/__init__.py @@ -1,9 +1,9 @@ """Finite-difference fields.""" +import importlib.metadata import os import pathlib import matplotlib.pyplot as plt -import pkg_resources import pytest from . import tools @@ -18,7 +18,7 @@ # Enable default plotting style. plt.style.use(pathlib.Path(__file__).parent / "plotting" / "plotting-style.mplstyle") -__version__ = pkg_resources.get_distribution(__name__).version +__version__ = importlib.metadata.version(__package__) def test():