watchdock-errors 0.5.0__tar.gz → 0.5.1__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.
Files changed (28) hide show
  1. {watchdock_errors-0.5.0/src/watchdock_errors.egg-info → watchdock_errors-0.5.1}/PKG-INFO +1 -1
  2. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/integrations/celery.py +6 -1
  3. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1/src/watchdock_errors.egg-info}/PKG-INFO +1 -1
  4. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors.egg-info/SOURCES.txt +1 -0
  5. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors.egg-info/scm_file_list.json +1 -0
  6. watchdock_errors-0.5.1/src/watchdock_errors.egg-info/scm_version.json +8 -0
  7. watchdock_errors-0.5.1/tests/test_celery_schedule.py +27 -0
  8. watchdock_errors-0.5.0/src/watchdock_errors.egg-info/scm_version.json +0 -8
  9. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/.github/workflows/ci.yml +0 -0
  10. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/.github/workflows/release.yml +0 -0
  11. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/.gitignore +0 -0
  12. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/README.md +0 -0
  13. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/pyproject.toml +0 -0
  14. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/setup.cfg +0 -0
  15. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/__init__.py +0 -0
  16. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/client.py +0 -0
  17. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/config.py +0 -0
  18. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/event.py +0 -0
  19. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/integrations/__init__.py +0 -0
  20. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/integrations/django.py +0 -0
  21. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/integrations/fastapi.py +0 -0
  22. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors/utils.py +0 -0
  23. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors.egg-info/dependency_links.txt +0 -0
  24. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors.egg-info/requires.txt +0 -0
  25. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/src/watchdock_errors.egg-info/top_level.txt +0 -0
  26. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/tests/test_client.py +0 -0
  27. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/tests/test_event.py +0 -0
  28. {watchdock_errors-0.5.0 → watchdock_errors-0.5.1}/tests/test_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: watchdock-errors
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: Application error tracking SDK for the Watchdock platform
5
5
  License: MIT
6
6
  Keywords: error-tracking,observability,watchdock
@@ -39,6 +39,7 @@ from __future__ import annotations
39
39
 
40
40
  import logging
41
41
  import threading
42
+ from datetime import timedelta
42
43
  from typing import TYPE_CHECKING
43
44
 
44
45
  import requests
@@ -230,7 +231,11 @@ def _serialize_schedule(entry) -> dict | None:
230
231
  "month_of_year": schedule._orig_month_of_year,
231
232
  }
232
233
 
233
- seconds = getattr(schedule, "seconds", schedule) # celery.schedules.schedule or plain number
234
+ # timedelta.seconds is only the seconds component (a 1-day timedelta has 0), so use the total.
235
+ if isinstance(schedule, timedelta):
236
+ seconds = schedule.total_seconds()
237
+ else:
238
+ seconds = getattr(schedule, "seconds", schedule) # celery.schedules.schedule or plain number
234
239
  try:
235
240
  return {"type": "interval", "every_seconds": float(seconds)}
236
241
  except (TypeError, ValueError):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: watchdock-errors
3
- Version: 0.5.0
3
+ Version: 0.5.1
4
4
  Summary: Application error tracking SDK for the Watchdock platform
5
5
  License: MIT
6
6
  Keywords: error-tracking,observability,watchdock
@@ -19,6 +19,7 @@ src/watchdock_errors/integrations/__init__.py
19
19
  src/watchdock_errors/integrations/celery.py
20
20
  src/watchdock_errors/integrations/django.py
21
21
  src/watchdock_errors/integrations/fastapi.py
22
+ tests/test_celery_schedule.py
22
23
  tests/test_client.py
23
24
  tests/test_event.py
24
25
  tests/test_utils.py
@@ -14,6 +14,7 @@
14
14
  "src/watchdock_errors/integrations/django.py",
15
15
  "src/watchdock_errors/integrations/fastapi.py",
16
16
  "src/watchdock_errors/utils.py",
17
+ "tests/test_celery_schedule.py",
17
18
  "tests/test_client.py",
18
19
  "tests/test_event.py",
19
20
  "tests/test_utils.py"
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.5.1",
3
+ "distance": 0,
4
+ "node": "gb0377378e2104011329ee7fcc784a7dee3e4c227",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-11-13"
8
+ }
@@ -0,0 +1,27 @@
1
+ from datetime import timedelta
2
+ from types import SimpleNamespace
3
+
4
+ from watchdock_errors.integrations.celery import _serialize_schedule
5
+
6
+
7
+ def test_number_is_an_interval():
8
+ assert _serialize_schedule({"schedule": 300}) == {"type": "interval", "every_seconds": 300.0}
9
+
10
+
11
+ def test_timedelta_uses_total_seconds():
12
+ assert _serialize_schedule({"schedule": timedelta(minutes=5)})["every_seconds"] == 300.0
13
+ assert _serialize_schedule({"schedule": timedelta(days=1)})["every_seconds"] == 86400.0
14
+ assert _serialize_schedule({"schedule": timedelta(days=1, hours=2)})["every_seconds"] == 93600.0
15
+
16
+
17
+ def test_celery_schedule_object_uses_its_seconds():
18
+ assert _serialize_schedule({"schedule": SimpleNamespace(seconds=86400.0)})["every_seconds"] == 86400.0
19
+
20
+
21
+ def test_crontab_is_not_an_interval():
22
+ cron = SimpleNamespace(_orig_minute="0", _orig_hour="3", _orig_day_of_week="*", _orig_day_of_month="*", _orig_month_of_year="*")
23
+ assert _serialize_schedule({"schedule": cron})["type"] == "crontab"
24
+
25
+
26
+ def test_missing_schedule():
27
+ assert _serialize_schedule({}) is None
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "0.5.0",
3
- "distance": 0,
4
- "node": "gb60ccd75b33be3b29188767aa21e15ab18047fb6",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-08-27"
8
- }