Repository navigation
ref(compat): Remove always-true PY37 flag and nanosecond_time helper - #8154
Merged
Merged
Conversation
Co-Authored-By: Ivana Kellyer <ivana.kellyer@sentry.io>
Co-Authored-By: Ivana Kellyer <ivana.kellyer@sentry.io>
sentrivana
approved these changes
Oct 29, 2026
Contributor
Coverage Results 📊✅ 57523 passed | ⏭️ 2979 skipped | Total: 60502 | Pass Rate: 95.08% | Execution Time: 160m 60s All tests are passing successfully. ✅ Patch coverage is 100.00% (3 of 3 changed executable lines covered; target 80%). Changed files with executable lines (1)
Coverage diff@@ Coverage Diff @@
## master #8154 +/-##
==========================================
- Coverage 90.33% 90.20% -0.13%
==========================================
Files 203 198 -5
Tracked lines 26872 21307 -5565
Branches 10044 7378 -2666
==========================================
- Hits 24272 19218 -5054
+ Misses 2600 2089 -511
+ Partials 1520 1237 -283Generated by Coverage Action |
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
Removes the
PY37flag fromsentry_sdk/_compat.py, along with the code paths that only ran when it wasFalse. It also removes thenanosecond_time()wrapper, which existed only to choose between those paths.setup.pysetspython_requires=">=3.7", soPY37is alwaysTrueon every supported interpreter, and thetox.inimatrix starts at py3.7. That makes these branches unreachable:nanosecond_time()insentry_sdk/utils.py: theint(time.perf_counter() * 1e9)fallback is gone. Once onlytime.perf_counter_ns()was left, the wrapper added nothing, so it's removed as well. Its two call sites insentry_sdk/traces.py(Spanstart and end) now calltime.perf_counter_ns()directly.tests/test_gevent.py:compression_algoalways includes"br"now, as it already did in practice.tests/test_transport.py:elif PY37:becomeselse:, and the pre-3.7 case list after it is removed. The cases that run on 3.7 are unchanged.PY38,PY310andPY311are still used, so they stay. This doesn't depend on #8153; the two only touch different lines of_compat.pyand merge cleanly together._compatandutilsare private modules, and nothing else in the repo (including tests) referencesnanosecond_time. Runtime behavior doesn't change on any supported Python version.Issues
n/a
via Ivana Kellyer.
--
View Junior Session [Sentry]