teams-alerter 0.1.1__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: teams-alerter
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Module pour envoyer des alertes Teams via Pub/Sub
5
5
  Author-email: Toki <t.bakotondrabe-ext@paris-turf.com>
6
6
  License: MIT
@@ -76,11 +76,10 @@ twine upload dist/*
76
76
 
77
77
  ```
78
78
  teams-alerter/
79
- ├── src/
80
- └── teams_alerter/
81
- ├── __init__.py
82
- ├── core.py
83
- │ └── utils.py
79
+ ├── teams_alerter/
80
+ ├── __init__.py
81
+ ├── core.py
82
+ └── utils.py
84
83
  ├── pyproject.toml
85
84
  ├── README.md
86
85
  └── dist/
@@ -65,11 +65,10 @@ twine upload dist/*
65
65
 
66
66
  ```
67
67
  teams-alerter/
68
- ├── src/
69
- └── teams_alerter/
70
- ├── __init__.py
71
- ├── core.py
72
- │ └── utils.py
68
+ ├── teams_alerter/
69
+ ├── __init__.py
70
+ ├── core.py
71
+ └── utils.py
73
72
  ├── pyproject.toml
74
73
  ├── README.md
75
74
  └── dist/
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "teams-alerter"
7
- version = "0.1.1"
7
+ version = "0.1.3"
8
8
  description = "Module pour envoyer des alertes Teams via Pub/Sub"
9
9
  authors = [{ name = "Toki", email = "t.bakotondrabe-ext@paris-turf.com" }]
10
10
  readme = "README.md"
@@ -2,15 +2,15 @@ import json
2
2
  import traceback
3
3
 
4
4
  from google.cloud import pubsub_v1
5
- from utils import ErrorUtils, DateUtils
5
+ from .utils import ErrorUtils, DateUtils
6
6
 
7
7
 
8
8
  class TeamsAlerter:
9
+
9
10
  def __init__(
10
11
  self,
11
- utils,
12
- app_name,
13
- teams_channel,
12
+ utils: ErrorUtils,
13
+ teams_channel: str,
14
14
  detail,
15
15
  level,
16
16
  environment=None,
@@ -19,7 +19,6 @@ class TeamsAlerter:
19
19
  teams_template=None,
20
20
  ):
21
21
  self.utils = utils
22
- self.app_name = app_name
23
22
  self.teams_channel = teams_channel
24
23
  self.detail = detail
25
24
  self.environment = environment
@@ -36,7 +35,6 @@ class TeamsAlerter:
36
35
 
37
36
  teams_alerter = TeamsAlerter(
38
37
  utils=utils,
39
- app_name="datastream-transaction-pub",
40
38
  teams_channel=f"datastream-{utils['env']}-alerts",
41
39
  detail=f"Error type: {error_type}\nError message: {error_message}\nError traceback: {error_traceback}",
42
40
  level="ERROR",
@@ -50,7 +48,7 @@ class TeamsAlerter:
50
48
  utc_timestamp = DateUtils.get_str_utc_timestamp()
51
49
  payload = json.dumps(
52
50
  {
53
- "app_name": self.app_name,
51
+ "app_name": self.utils["app_name"],
54
52
  "teams_channel": self.teams_channel,
55
53
  "detail": self.detail,
56
54
  "level": self.level,
@@ -10,6 +10,7 @@ class ErrorUtils(TypedDict):
10
10
  app_project_id: str
11
11
  topic_project_id: str
12
12
  topic_id: str
13
+ app_name: str
13
14
 
14
15
 
15
16
  class DateUtils:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: teams-alerter
3
- Version: 0.1.1
3
+ Version: 0.1.3
4
4
  Summary: Module pour envoyer des alertes Teams via Pub/Sub
5
5
  Author-email: Toki <t.bakotondrabe-ext@paris-turf.com>
6
6
  License: MIT
@@ -76,11 +76,10 @@ twine upload dist/*
76
76
 
77
77
  ```
78
78
  teams-alerter/
79
- ├── src/
80
- └── teams_alerter/
81
- ├── __init__.py
82
- ├── core.py
83
- │ └── utils.py
79
+ ├── teams_alerter/
80
+ ├── __init__.py
81
+ ├── core.py
82
+ └── utils.py
84
83
  ├── pyproject.toml
85
84
  ├── README.md
86
85
  └── dist/
File without changes