sauron-sdk 1.0.0__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 (37) hide show
  1. sauron_sdk-1.0.0/CHANGELOG.md +63 -0
  2. sauron_sdk-1.0.0/LICENSE +661 -0
  3. sauron_sdk-1.0.0/MANIFEST.in +2 -0
  4. sauron_sdk-1.0.0/PKG-INFO +135 -0
  5. sauron_sdk-1.0.0/README.md +104 -0
  6. sauron_sdk-1.0.0/pyproject.toml +49 -0
  7. sauron_sdk-1.0.0/sauron/__init__.py +326 -0
  8. sauron_sdk-1.0.0/sauron/_autocapture.py +82 -0
  9. sauron_sdk-1.0.0/sauron/_client.py +420 -0
  10. sauron_sdk-1.0.0/sauron/_dsn.py +114 -0
  11. sauron_sdk-1.0.0/sauron/_gzip.py +28 -0
  12. sauron_sdk-1.0.0/sauron/_queue.py +194 -0
  13. sauron_sdk-1.0.0/sauron/_scope.py +251 -0
  14. sauron_sdk-1.0.0/sauron/_stacktrace.py +87 -0
  15. sauron_sdk-1.0.0/sauron/_transport.py +358 -0
  16. sauron_sdk-1.0.0/sauron/py.typed +0 -0
  17. sauron_sdk-1.0.0/sauron_sdk.egg-info/PKG-INFO +135 -0
  18. sauron_sdk-1.0.0/sauron_sdk.egg-info/SOURCES.txt +35 -0
  19. sauron_sdk-1.0.0/sauron_sdk.egg-info/dependency_links.txt +1 -0
  20. sauron_sdk-1.0.0/sauron_sdk.egg-info/requires.txt +3 -0
  21. sauron_sdk-1.0.0/sauron_sdk.egg-info/top_level.txt +1 -0
  22. sauron_sdk-1.0.0/setup.cfg +4 -0
  23. sauron_sdk-1.0.0/tests/test_autocapture.py +155 -0
  24. sauron_sdk-1.0.0/tests/test_beforesend.py +94 -0
  25. sauron_sdk-1.0.0/tests/test_breadcrumbs.py +123 -0
  26. sauron_sdk-1.0.0/tests/test_dsn.py +54 -0
  27. sauron_sdk-1.0.0/tests/test_envelope.py +157 -0
  28. sauron_sdk-1.0.0/tests/test_golden.py +286 -0
  29. sauron_sdk-1.0.0/tests/test_gzip.py +109 -0
  30. sauron_sdk-1.0.0/tests/test_metadata.py +164 -0
  31. sauron_sdk-1.0.0/tests/test_queue.py +191 -0
  32. sauron_sdk-1.0.0/tests/test_retry.py +216 -0
  33. sauron_sdk-1.0.0/tests/test_scope.py +147 -0
  34. sauron_sdk-1.0.0/tests/test_stacktrace.py +69 -0
  35. sauron_sdk-1.0.0/tests/test_transaction.py +104 -0
  36. sauron_sdk-1.0.0/tests/test_transport.py +124 -0
  37. sauron_sdk-1.0.0/tests/test_transport_options.py +76 -0
@@ -0,0 +1,63 @@
1
+ # Changelog
2
+
3
+ All notable changes to the Sauron Python SDK are documented here.
4
+
5
+ ## 1.0.0 - 2026-07-27
6
+
7
+ First public release. Prior `0.x` versions were internal-only and were never
8
+ published to PyPI.
9
+
10
+ - **Fixed: a rejected envelope was replayed from disk forever.** Persisted files were only
11
+ deleted on success, so a payload the server permanently refuses (e.g. a `400`) was reloaded
12
+ and re-sent on every process start. Rejections now delete their persisted copies; transient
13
+ failures still keep them for retry.
14
+ - **Fixed: oversized envelopes.** The whole queue went out as one envelope, so a recovered
15
+ backlog could exceed the server's 1000-item limit and be dropped as a non-retryable `400`.
16
+ Envelopes are now capped at `MAX_ITEMS_PER_ENVELOPE` (1000) and the queue drains in chunks.
17
+ - `413` is no longer retried unchanged — the envelope is split in half and each half sent.
18
+
19
+ ## 0.3.0
20
+
21
+ The **parity release** — brings the Python SDK up to the Browser/Flutter feature
22
+ bar and reconciles the emitted wire shape with the canonical contract in
23
+ `backend/crates/sauron-core/src/envelope.rs`. Stdlib only; no new runtime deps.
24
+
25
+ ### Added
26
+
27
+ - **Scope + per-request isolation** built on `contextvars`: `set_user`,
28
+ `set_tag`, `set_tags`, `set_context`, `set_extra`, `configure_scope`, and the
29
+ `scope()` context manager (plus `push_scope`/`pop_scope`). Concurrent requests
30
+ no longer leak each other's user/tags/breadcrumbs.
31
+ - **Breadcrumbs**: `add_breadcrumb(...)` on the active scope (bounded ring,
32
+ `max_breadcrumbs` default 100) with an optional `before_breadcrumb` hook.
33
+ Captured errors now attach the scope's breadcrumb trail.
34
+ - **`before_send(item, hint)`** hook — runs on **every** outgoing item
35
+ (error/event/identify/transaction); return `None` to drop.
36
+ - **`track_transaction(...)`** — manual performance transactions
37
+ (`envelope.rs::TransactionItem`); `distinct_id` falls back to the scoped user.
38
+ - **Gzip** request compression over `gzip_threshold_bytes` (default 1024) with
39
+ `Content-Encoding: gzip`.
40
+ - **Retry policy** aligned to the shared table (retry 408/413/429/5xx + network,
41
+ honor `Retry-After` on 429, drop on 400/401/403/404, cap 30s).
42
+ - **Bounded in-memory queue** (`max_queue_bytes`, drop-oldest) with opt-in FIFO
43
+ disk persistence via `offline_path` (reloaded on init, deleted on delivery).
44
+ - **Opt-in auto uncaught-error capture** — `init(auto_capture_unhandled=True)`
45
+ installs `sys.excepthook` (and `threading.excepthook`) that capture with
46
+ `mechanism.handled=false`, then delegate to the previous hook so the default
47
+ crash/exit behavior is preserved. Off by default.
48
+ - **Graceful shutdown** — `init` registers an `atexit` flush (idempotent);
49
+ `flush()` / `close()` remain available.
50
+ - **Fingerprint override** — `capture_exception(..., fingerprint=[...])` honored
51
+ verbatim by the backend for custom grouping.
52
+ - **Golden-envelope fixture test** guarding byte/shape parity with the shared
53
+ golden (server error item with breadcrumbs+tags+user+fingerprint, an event, an
54
+ identify, and a transaction).
55
+
56
+ ### Changed
57
+
58
+ - `SDK_VERSION` and the package version bumped to **0.3.0**.
59
+
60
+ ## 0.1.0
61
+
62
+ - Initial server-side SDK: `init`, `track`, `identify`, `capture_exception`,
63
+ `capture_message`, buffered background `urllib` transport, DSN parsing.