Skip to content

chore(compat): add CURRENT_PY_VERSION and bump NEXT_PY_VERSION to 3.16 (PROF-14439) - #19928

Draft
vlad-scherbich wants to merge 2 commits into
vlad/py315-riotfilefrom
vlad/py315-current-py-version
Draft

chore(compat): add CURRENT_PY_VERSION and bump NEXT_PY_VERSION to 3.16 (PROF-14439)#19928
vlad-scherbich wants to merge 2 commits into
vlad/py315-riotfilefrom
vlad/py315-current-py-version

Conversation

@vlad-scherbich

@vlad-scherbich vlad-scherbich commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Description

Delta vs #19906.

Adds CURRENT_PY_VERSION = "3.15" and bumps NEXT_PY_VERSION 3.15→3.16. wrap(), @lazy, monitoring's import gate, and PEP 810 coverage shifts that meant "this CPython" now key off CURRENT_*. wrap()/wrap_bytecode() still raise on 3.15 (they compare against CURRENT, not the new NEXT). SSI allow-list is unchanged (comment only).

Layer Meaning Which PR
Compiled into artifact n/a
Armed at runtime wrap() still raises on 3.15 lift is #19910
Observable in product/Python CURRENT/NEXT constants this PR

Testing

A constants test pins CURRENT=3.15 and NEXT=3.16. wrap() degrade skipifs key off CURRENT so wrap() still asserts NotImplementedError on 3.15.

Risks

None. Thresholds that were NEXT=3.15 keep the same numeric cut via CURRENT.

Additional Notes

Does not enable wrap(), riot 3.15 jobs, wheels, or SSI. requires-python stays >=3.9,<3.15. Overlap: #19910 (on main) also bumps NEXT to 3.16 and owns wrap() behavior.

No release note: internal constants, changelog/no-changelog.

@vlad-scherbich vlad-scherbich added the changelog/no-changelog A changelog entry is not required for this PR. label Aug 28, 2026
@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 28, 2026

Copy link
Copy Markdown

Circular import analysis

⚠️ Existing circular imports

There are 3 circular imports that already exist on the base branch and have not been changed by this PR.

ddtrace.errortracking._handled_exceptions.bytecode_injector -> ddtrace.errortracking._handled_exceptions.callbacks -> ddtrace.errortracking._handled_exceptions.collector -> ddtrace.errortracking._handled_exceptions.bytecode_reporting -> ddtrace.errortracking._handled_exceptions.bytecode_injector
ddtrace.llmobs -> ddtrace.llmobs._evaluators -> ddtrace.llmobs._evaluators.format -> ddtrace.llmobs._experiment -> ddtrace.llmobs
ddtrace.appsec._asm_request_context -> ddtrace.appsec._iast._iast_request_context_base -> ddtrace.appsec._iast._iast_env -> ddtrace.appsec._iast.reporter -> ddtrace.appsec._exploit_prevention.stack_traces -> ddtrace.appsec._asm_request_context

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 28, 2026

Copy link
Copy Markdown

Dependency direction analysis

⚠️ Existing dependency direction violations

There are 240 dependency direction violations that already exist on the base branch and have not been changed by this PR.

Show existing violations (showing 5 of 240 highest severity)
ddtrace.internal.tracemethods -×-> ddtrace.trace  (internal-core -> product:tracing, score=135)
ddtrace.internal.ci_visibility.recorder -×-> ddtrace.trace  (product:ci_visibility -> product:tracing, score=133)
ddtrace.debugging._debugger -×-> ddtrace.trace  (product:debugging -> product:tracing, score=133)
ddtrace.internal.ci_visibility.git_client -×-> ddtrace.trace  (product:ci_visibility -> product:tracing, score=133)
ddtrace.appsec._contrib.flask -×-> ddtrace.trace  (product:appsec -> product:tracing, score=133)

To see all violations, download the layers-base.json and layers-pr.json artifacts from this CI job and run:

uv run --script scripts/import-analysis/layers.py compare layers-base.json layers-pr.json

@cit-pr-commenter-54b7da

cit-pr-commenter-54b7da Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codeowners resolved as

Resolved from the full PR diff against vlad/py315-riotfile using the target branch CODEOWNERS file.
CODEOWNERS team requests not listed below are not required by the current file set.

ddtrace/internal/compat.py                                              @DataDog/python-guild @DataDog/apm-core-python
ddtrace/internal/coverage/instrumentation_py3_12.py                     @DataDog/ci-app-libraries
ddtrace/internal/module.py                                              @DataDog/debugger-python @DataDog/apm-core-python
ddtrace/internal/monitoring.py                                          @DataDog/apm-core-python
ddtrace/internal/wrapping/__init__.py                                   @DataDog/apm-core-python
lib-injection/sources/sitecustomize.py                                  @DataDog/apm-core-python
tests/internal/test_py315_import_degrade.py                             @DataDog/apm-core-python

@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-manylinux-wheels branch from dff1fad to 1d382ed Compare August 28, 2026 14:57
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-current-py-version branch from 9be2db6 to b142960 Compare August 28, 2026 15:04
@vlad-scherbich
vlad-scherbich changed the base branch from vlad/py315-manylinux-wheels to vlad/py315-riotfile August 28, 2026 15:04
@pr-commenter

pr-commenter Bot commented Aug 28, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-08-28 19:14:12

Comparing candidate commit c8b4968 in PR branch vlad/py315-current-py-version with baseline commit 23f857d in branch main.

📊 Benchmarking dashboard

Found 0 performance improvements and 8 performance regressions! Performance is the same for 574 metrics, 10 unstable metrics, 1 known flaky benchmarks, 17 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

scenario:httppropagationinject-ids_only

  • 🟥 execution_time [+2.467µs; +2.628µs] or [+14.685%; +15.644%]

scenario:iastaspects-add_aspect

  • 🟥 execution_time [+9.237µs; +11.072µs] or [+9.206%; +11.034%]

scenario:iastaspects-repr_aspect

  • 🟥 execution_time [+64.278µs; +72.066µs] or [+17.366%; +19.470%]

scenario:iastaspects-upper_aspect

  • 🟥 execution_time [+75.252µs; +80.696µs] or [+32.447%; +34.794%]

scenario:iastaspectsospath-ospathbasename_aspect

  • 🟥 execution_time [+127.185µs; +136.088µs] or [+31.937%; +34.173%]

scenario:iastaspectssplit-rsplit_aspect

  • 🟥 execution_time [+38.678µs; +44.021µs] or [+27.431%; +31.220%]

scenario:telemetryaddmetric-1-count-metric-1-times

  • 🟥 execution_time [+637.084ns; +665.517ns] or [+23.505%; +24.554%]

scenario:tracer-small

  • 🟥 execution_time [+34.431µs; +37.529µs] or [+10.814%; +11.787%]

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:coreapiscenario-context_with_data_listeners

  • unstable execution_time [-721.241ns; +745.641ns] or [-6.592%; +6.815%]

scenario:coreapiscenario-core_dispatch_1_listener

  • unstable execution_time [-33.975ns; +32.431ns] or [-5.595%; +5.341%]

scenario:coreapiscenario-core_dispatch_50_listeners

  • unstable execution_time [-1640.695ns; +1650.202ns] or [-9.628%; +9.684%]

scenario:coreapiscenario-core_dispatch_exception_listeners

  • unstable execution_time [-1443.596ns; +1176.407ns] or [-10.714%; +8.731%]

scenario:coreapiscenario-core_dispatch_listeners

  • unstable execution_time [-327.241ns; +326.000ns] or [-8.873%; +8.839%]

scenario:coreapiscenario-core_dispatch_no_args_listeners

  • unstable execution_time [-260.685ns; +253.163ns] or [-8.872%; +8.616%]

scenario:coreapiscenario-core_dispatch_with_results_1_listener

  • unstable execution_time [-75.897ns; +69.248ns] or [-6.456%; +5.890%]

scenario:coreapiscenario-core_dispatch_with_results_50_listeners

  • unstable execution_time [-4114.285ns; +3794.238ns] or [-10.108%; +9.321%]

scenario:coreapiscenario-core_dispatch_with_results_listeners

  • unstable execution_time [-850.924ns; +699.975ns] or [-10.449%; +8.596%]

scenario:packagesupdateimporteddependencies-import_many_stdlib_cached

  • unstable execution_time [-59269.655ns; +58611.276ns] or [-9.507%; +9.401%]

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

scenario:span-start

  • 🟥 execution_time [+1.536ms; +1.774ms] or [+11.349%; +13.105%]

Known flaky benchmarks without significant changes:

  • scenario:errortrackingflasksqli-baseline
  • scenario:flasksimple-iast-get
  • scenario:iastaspects-casefold_aspect
  • scenario:iastaspects-casefold_noaspect
  • scenario:iastaspects-index_aspect
  • scenario:iastaspects-ljust_noaspect
  • scenario:iastaspects-lower_aspect
  • scenario:iastaspects-replace_aspect
  • scenario:iastaspects-swapcase_aspect
  • scenario:iastaspects-title_noaspect
  • scenario:iastaspects-translate_aspect
  • scenario:iastaspects-translate_noaspect
  • scenario:iastaspects-upper_noaspect
  • scenario:packagespackageforrootmodulemapping-cache_off
  • scenario:packagespackageforrootmodulemapping-cache_on
  • scenario:sethttpmeta-all-enabled
  • scenario:telemetryaddmetric-record-100-metrics

@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-current-py-version branch from b142960 to a2f5c63 Compare August 28, 2026 15:51
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-current-py-version branch from a2f5c63 to 3f0ff70 Compare August 28, 2026 16:07
@datadog-prod-us1-6

datadog-prod-us1-6 Bot commented Aug 28, 2026

Copy link
Copy Markdown

Pipelines

Unblock PR with BitsAI

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 1 Pipeline job failed

DataDog/apm-reliability/dd-trace-py | rust ci — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 96f4866 | Docs | View more details | Give us feedback!

Centralize the 3.15 wiring bound and the 3.16 fail-closed bound so wrap()
can keep raising on 3.15 while NEXT_PY means first unsupported.
@vlad-scherbich
vlad-scherbich force-pushed the vlad/py315-current-py-version branch from 3f0ff70 to c8b4968 Compare August 28, 2026 18:36
@vlad-scherbich vlad-scherbich changed the title chore(compat): add CURRENT_PY_VERSION and bump NEXT_PY_VERSION to 3.16 chore(compat): add CURRENT_PY_VERSION and bump NEXT_PY_VERSION to 3.16 (PROF-14439) Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/no-changelog A changelog entry is not required for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant