summarylogtreecommitdiffstats
path: root/phabricator-D252875.patch
blob: 979958912cd8c81bbc10a03daa9de698ce548e0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
diff --git a/mozphab/sentry.py b/mozphab/sentry.py
--- a/mozphab/sentry.py
+++ b/mozphab/sentry.py
@@ -1,26 +1,25 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 import errno
+import importlib.metadata
 import logging
 import socket
 import ssl
 import urllib.error
 
 import hglib.error
 import sentry_sdk
-from pkg_resources import get_distribution
 from sentry_sdk.integrations.logging import LoggingIntegration
 
+from .environment import MOZPHAB_VERSION
 from .exceptions import CommandError
 
 
 def init_sentry():
-    distribution = get_distribution("MozPhab")
-
     sentry_logging = LoggingIntegration(
         level=logging.INFO,
         event_level=None,
         # The default event_level is logging.ERROR, which will report any
         # "logging.error(...)" call to Sentry.  However, we respond to
@@ -30,11 +29,11 @@
     sentry_sdk.init(
         dsn=(
             "https://f2dcfa028ddb4540b5d64a855d480909@o1069899.ingest.sentry.io/6250015"
         ),
         integrations=[sentry_logging],
-        release=distribution.version,
+        release=MOZPHAB_VERSION,
     )
 
 
 def report_to_sentry(e):
     if (
diff --git a/mozphab/updater.py b/mozphab/updater.py
--- a/mozphab/updater.py
+++ b/mozphab/updater.py
@@ -9,12 +9,11 @@
 import time
 import urllib.request
 from pathlib import Path
 from typing import Optional
 
-from packaging.version import Version
-from pkg_resources import parse_version
+from packaging.version import parse as parse_version, Version
 from setuptools import Distribution
 
 from mozphab import environment
 
 from .config import config