Repository navigation
[do not merge] Testing merge - #8243
Conversation
### Description QoL improvement to make `--only`/`--skip` more useful. Running `populate_tox.py` with `--only` (or `--skip`) wiped most of the jsonl caches. At the end of each run, both `releases.jsonl` and `package_dependencies.jsonl` are rewritten to contain only entries that were accessed during the run. Skipped integrations are read from the existing `tox.ini` and never touch their `releases.jsonl` entries or their free-threading dependency entries, so all of those got pruned. Now unused entries are only pruned on full runs. Partial runs still sort the files and add newly fetched entries, but don't drop anything. Stale entries for the updated packages stick around until the next full run.
Update our test matrix with new releases of integrated frameworks and libraries. ## How it works - Scan PyPI for all supported releases of all frameworks we have a dedicated test suite for. - Pick a representative sample of releases to run our test suite against. We always test the latest and oldest supported version. - Update [tox.ini](https://github.com/getsentry/sentry-python/blob/master/tox.ini) with the new releases. ## Action required - If CI passes on this PR, it's safe to approve and merge. It means our integrations can handle new versions of frameworks that got pulled in. - If CI doesn't pass on this PR, this points to an incompatibility of either our integration or our test setup with a new version of a framework. - Check what the failures look like and either fix them, or update the [test config](https://github.com/getsentry/sentry-python/blob/master/scripts/populate_tox/config.py) and rerun [scripts/generate-test-files.sh](https://github.com/getsentry/sentry-python/blob/master/scripts/generate-test-files.sh). See [scripts/populate_tox/README.md](https://github.com/getsentry/sentry-python/blob/master/scripts/populate_tox/README.md) for what configuration options are available. _____________________ _🤖 This PR was automatically created using [a GitHub action](https://github.com/getsentry/sentry-python/blob/master/.github/workflows/update-tox.yml)._ --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
…vocation (#8134) ### Description Path-style handlers, e.g. `SENTRY_INITIAL_HANDLER=app/index.handler`, were manually loaded and never cached unlike dotted handlers, e.g. `index.handler` which automatically ended up in `sys.modules`; so module was loaded again on every warm invocation and state was lost. #### Changes & Results Loader now does the same as [Lambda runtime itself](https://github.com/aws/aws-lambda-python-runtime-interface-client/blob/fa2462d93d11da632aad8f8bfb07a3e060438150/awslambdaric/bootstrap.py#L53): `/` is turned into `.` and `importlib.import(...)` is called; Python caches the module, so it runs exactly once per execution environment. Some results below on a Lambda function (python3.13, arm64, 512 MB) that creates 3 boto3 clients at import: <img width="1350" height="825" alt="warm-duration" src="https://github.com/user-attachments/assets/167e6cd4-c6cf-45fa-9e8c-46c8aa56076a" /> Warm invocations: p50 122ms => 58ms; p99 180ms => 69ms. <img width="1350" height="750" alt="cold-start" src="https://github.com/user-attachments/assets/f4a0cfc3-ccdb-4919-a690-153b955da906" /> Cold starts remain the same, 1.4s for both. <img width="1350" height="825" alt="memory" src="https://github.com/user-attachments/assets/1edeb09d-b75a-4b35-a35d-9998637217bc" /> Peak memory also drops from 117 MB => 108 MB and is fixed on invocations, unlike the old layer which grows over time because each call creates new clients. #### Issues Resolves #8079 & PY-3016 --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer <131587164+sentrivana@users.noreply.github.com>
Fixes clear-cut misspellings across comments, docstrings, script output, and a few local or test-only identifiers. Found with `codespell` and `typos`, and every hit was checked by hand. Nothing public changes. The renamed identifiers are a local variable in `sentry_sdk/utils.py` (`should_supress_context`), a local in `scripts/find_raise_from_none.py`, a test-local variable, and three test function names. These were left alone on purpose: - `dependant`: FastAPI's own API name - `checkin`: Sentry crons terminology - `deprecat`: regex prefix in `.github/release.yml` - `need_code_loation`: old method name quoted in `MIGRATION_GUIDE.md` - `baGGage`: tests that header matching ignores case - Chunked test strings like `"hel"` and `"ons"` - Typos in `CHANGELOG.md`, since those are historical release notes <!-- junior-request-attribution:start --> via @sentrivana. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1794390864.677739 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1794390864.677739) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1794390864.677739/?project=4510944073809921) <!-- junior-session-footer:end --> Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: Ivana Kellyer <131587164+sentrivana@users.noreply.github.com>
Coverage Results 📊✅ 58057 passed | ❌ 1 failed | ⏭️ 3058 skipped | Total: 61116 | Pass Rate: 94.99% | Execution Time: 152m 20s 📊 Comparison with Base Branch
➕ New Tests (1)View new tests
❌ Failed Tests
|
| File | Coverage % | Lines |
|---|---|---|
sentry_sdk/utils.py |
92.33% | |
sentry_sdk/client.py |
92.64% | |
sentry_sdk/integrations/starlette.py |
90.60% | |
sentry_sdk/integrations/huggingface_hub.py |
89.90% | |
sentry_sdk/integrations/django/signals_handlers.py |
95.56% |
Coverage diff
@@ Coverage Diff @@
## master #8243 +/-##
==========================================
+ Coverage 90.27% 90.38% +0.11%
==========================================
Files 203 199 -4
Tracked lines 27114 21598 -5516
Branches 10136 7488 -2648
==========================================
- Hits 24475 19520 -4955
+ Misses 2639 2078 -561
+ Partials 1540 1253 -287Generated by Coverage Action
No description provided.