taskbadger 1.3.2__tar.gz → 1.3.4__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.
- {taskbadger-1.3.2 → taskbadger-1.3.4}/PKG-INFO +1 -1
- {taskbadger-1.3.2 → taskbadger-1.3.4}/pyproject.toml +2 -2
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/celery.py +8 -5
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/decorators.py +2 -2
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/safe_sdk.py +4 -4
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/sdk.py +1 -1
- {taskbadger-1.3.2 → taskbadger-1.3.4}/LICENSE +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/README.md +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/__init__.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/cli/__init__.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/cli/basics.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/cli/list_tasks.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/cli/utils.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/cli/wrapper.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/cli_main.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/config.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/exceptions.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/integrations.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/__init__.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/__init__.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/__init__.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_cancel.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_create.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_get.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_list.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_partial_update.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_update.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/task_endpoints/__init__.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/task_endpoints/task_cancel.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/task_endpoints/task_create.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/task_endpoints/task_get.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/task_endpoints/task_list.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/task_endpoints/task_partial_update.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/task_endpoints/task_update.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/client.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/errors.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/__init__.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/action.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/action_config.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/action_request.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/action_request_config.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/paginated_task_list.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/patched_action_request.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/patched_action_request_config.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/patched_task_request.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/patched_task_request_data.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/status_enum.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/task.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/task_data.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/task_request.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/task_request_data.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/py.typed +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/types.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/mug.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/process.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/systems/__init__.py +0 -0
- {taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/systems/celery.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "taskbadger"
|
|
3
|
-
version = "1.3.
|
|
3
|
+
version = "1.3.4"
|
|
4
4
|
description = "The official Python SDK for Task Badger"
|
|
5
5
|
license = "Apache-2.0"
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ readme = "README.md"
|
|
|
10
10
|
packages = [
|
|
11
11
|
{include = "taskbadger"},
|
|
12
12
|
]
|
|
13
|
-
include = ["
|
|
13
|
+
include = ["taskbadger/internal/py.typed"]
|
|
14
14
|
|
|
15
15
|
homepage = "https://taskbadger.net/"
|
|
16
16
|
repository = "https://github.com/taskbadger/taskbadger-python"
|
|
@@ -102,7 +102,6 @@ class Task(celery.Task):
|
|
|
102
102
|
|
|
103
103
|
def apply_async(self, *args, **kwargs):
|
|
104
104
|
headers = kwargs.setdefault("headers", {})
|
|
105
|
-
headers["taskbadger_track"] = True
|
|
106
105
|
tb_kwargs = self._get_tb_kwargs(kwargs)
|
|
107
106
|
if kwargs.get("kwargs"):
|
|
108
107
|
# extract taskbadger options from task kwargs when supplied as keyword argument
|
|
@@ -110,7 +109,11 @@ class Task(celery.Task):
|
|
|
110
109
|
elif len(args) > 1 and isinstance(args[1], dict):
|
|
111
110
|
# extract taskbadger options from task kwargs when supplied as positional argument
|
|
112
111
|
tb_kwargs.update(self._get_tb_kwargs(args[1]))
|
|
113
|
-
|
|
112
|
+
|
|
113
|
+
if Badger.is_configured():
|
|
114
|
+
headers["taskbadger_track"] = True
|
|
115
|
+
headers[TB_KWARGS_ARG] = tb_kwargs
|
|
116
|
+
|
|
114
117
|
result = super().apply_async(*args, **kwargs)
|
|
115
118
|
|
|
116
119
|
tb_task_id = result.info.get(TB_TASK_ID) if result.info else None
|
|
@@ -150,13 +153,13 @@ class Task(celery.Task):
|
|
|
150
153
|
@before_task_publish.connect
|
|
151
154
|
def task_publish_handler(sender=None, headers=None, body=None, **kwargs):
|
|
152
155
|
headers = headers if "task" in headers else body
|
|
156
|
+
header_kwargs = headers.pop(TB_KWARGS_ARG, {}) # always remove TB headers
|
|
153
157
|
if sender.startswith("celery.") or not Badger.is_configured():
|
|
154
158
|
return
|
|
155
159
|
|
|
156
160
|
celery_system = Badger.current.settings.get_system_by_id("celery")
|
|
157
161
|
auto_track = celery_system and celery_system.track_task(sender)
|
|
158
162
|
manual_track = headers.get("taskbadger_track")
|
|
159
|
-
header_kwargs = headers.pop(TB_KWARGS_ARG, {})
|
|
160
163
|
if not manual_track and not auto_track:
|
|
161
164
|
return
|
|
162
165
|
|
|
@@ -260,8 +263,8 @@ def exit_session(signal_sender):
|
|
|
260
263
|
def safe_get_task(task_id: str):
|
|
261
264
|
try:
|
|
262
265
|
return get_task(task_id)
|
|
263
|
-
except Exception:
|
|
264
|
-
log.
|
|
266
|
+
except Exception as e:
|
|
267
|
+
log.warning("Error fetching task '%s': %s", task_id, e)
|
|
265
268
|
|
|
266
269
|
|
|
267
270
|
def _get_taskbadger_task_id(request):
|
|
@@ -29,8 +29,8 @@ def create_task_safe(name: str, **kwargs: P.kwargs) -> Optional[Task]:
|
|
|
29
29
|
|
|
30
30
|
try:
|
|
31
31
|
return create_task(name, **kwargs)
|
|
32
|
-
except Exception:
|
|
33
|
-
log.
|
|
32
|
+
except Exception as e:
|
|
33
|
+
log.warning("Error creating task '%s': %s", name, e)
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
def update_task_safe(task_id: str, **kwargs: P.kwargs) -> Optional[Task]:
|
|
@@ -48,5 +48,5 @@ def update_task_safe(task_id: str, **kwargs: P.kwargs) -> Optional[Task]:
|
|
|
48
48
|
|
|
49
49
|
try:
|
|
50
50
|
return update_task(task_id, **kwargs)
|
|
51
|
-
except Exception:
|
|
52
|
-
log.
|
|
51
|
+
except Exception as e:
|
|
52
|
+
log.warning("Error updating task '%s': %s", task_id, e)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_cancel.py
RENAMED
|
File without changes
|
{taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_create.py
RENAMED
|
File without changes
|
{taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_get.py
RENAMED
|
File without changes
|
{taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_list.py
RENAMED
|
File without changes
|
|
File without changes
|
{taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/action_endpoints/action_update.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/api/task_endpoints/task_partial_update.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/patched_action_request_config.py
RENAMED
|
File without changes
|
|
File without changes
|
{taskbadger-1.3.2 → taskbadger-1.3.4}/taskbadger/internal/models/patched_task_request_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|