Skip to content

Commit 0b8f03a

Browse files
committed
Remove usage of deprecated pkg_resource in favor of importlib.metadata
In setup.py just remove a check for a 2018+ release of setuptools.
1 parent 4b0c8e9 commit 0b8f03a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

elasticapm/__init__.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
2929
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3030
import sys
31+
import importlib.metadata
3132

3233
from elasticapm.base import Client, get_client # noqa: F401
3334
from elasticapm.conf import setup_logging # noqa: F401
@@ -54,10 +55,7 @@
5455
_activation_method = None
5556

5657
try:
57-
try:
58-
VERSION = __import__("importlib.metadata").metadata.version("elastic-apm")
59-
except ImportError:
60-
VERSION = __import__("pkg_resources").get_distribution("elastic-apm").version
58+
VERSION = importlib.metadata.version("elastic-apm")
6159
except Exception:
6260
VERSION = "unknown"
6361

setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,8 @@
4444
import codecs
4545
import os
4646

47-
import pkg_resources
4847
from setuptools import setup
4948

50-
pkg_resources.require("setuptools>=39.2")
51-
5249

5350
def get_version():
5451
"""

0 commit comments

Comments
 (0)