Repository navigation
ref: Drop hub related code in new major - #6919
Merged
Merged
Conversation
Contributor
Codecov Results 📊✅ 98261 passed | ⏭️ 6731 skipped | Total: 104992 | Pass Rate: 93.59% | Execution Time: 357m 13s 📊 Comparison with Base Branch
All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 2487 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
- Coverage 89.84% 89.74% -0.1%
==========================================
Files 193 192 -1
Lines 24588 24239 -349
Branches 8744 8620 -124
==========================================
+ Hits 22089 21752 -337
- Misses 2499 2487 -12
- Partials 1400 1391 -9Generated by Codecov Action |
sentrivana
marked this pull request as ready for review
July 29, 2026 12:32
alexander-alderman-webb
approved these changes
Jul 29, 2026
sentrivana
added a commit
that referenced
this pull request
Oct 29, 2026
### Description Removes `with_metaclass()` from `sentry_sdk/_compat.py`. Nothing on `major/3.0` uses it anymore. It's a Python 2 / `six`-style helper for declaring a metaclass across Python versions; on Python 3 you just write `class Foo(metaclass=Meta)`. Its only caller was `class Hub(with_metaclass(HubMeta))` in `sentry_sdk/hub.py`. #6919 ("Drop hub related code in new major") deleted `Hub` and the import, but left the helper behind. With the helper gone, the `TYPE_CHECKING` block in `_compat.py` (`Any`, `TypeVar`, `T`) is unused too, so it's removed as well. `T` wasn't used before this change either. **Evidence** - On `major/3.0`, `git grep with_metaclass` matches only the definition. There are no callers in `sentry_sdk`, `tests`, `scripts` or `docs`. - Nothing imports `T` or `Any` from `sentry_sdk._compat`. - #6091 and #7421 (against `master`) proposed the same removal as part of larger Python 2 cleanups. Both were closed without being merged, one for inactivity. Neither raised an objection to this change. On `master`, `Hub` still uses the helper, so this only applies to `major/3.0`. `_compat` is a private module, so this doesn't touch the public API. #### Issues n/a <!-- junior-request-attribution:start --> via **Ivana Kellyer**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1793270559.842119 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119/?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 <ivana.kellyer@sentry.io>
sentrivana
added a commit
that referenced
this pull request
Oct 29, 2026
### Description Removes the private `_ScopeManager` class from `sentry_sdk/scope.py`. Nothing on `major/3.0` uses it anymore. It was the context manager behind `push_scope()` and the `Hub` scope helpers. #6919 ("Drop hub related code in new major") and #6944 ("Remove `push_scope`, `configure_scope` in new major") removed those callers and their imports, but left the class behind. **Evidence** - On `major/3.0`, `git grep -w _ScopeManager` matches only the class definition in `sentry_sdk/` and `tests/`. The only other hits are historical `CHANGELOG.md` and `MIGRATION_GUIDE.md` entries from 2.0 about it moving out of `sentry_sdk.hub`. - No open PR touches it. It's underscore-private and isn't exported, so this doesn't touch the public API. #### Issues n/a <!-- junior-request-attribution:start --> via **Ivana Kellyer**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0BTREZTS2Z%3A1793270559.842119 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0BTREZTS2Z%3A1793270559.842119/?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 <ivana.kellyer@sentry.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove everything hub related, including all sorts of compatibility shims around hubs/scopes.
Also remove deprecated session methods.
configure_scopeandpush_scoperemoval coming in a future PR.Issues
Closes #5001
Reminders
uv run ruff.feat:,fix:,ref:,meta:)