Skip to content

ddtrace==2.3.0 is incompatible with Python 3.13 #1606

@b-per

Description

@b-per

Problem

The test dependency ddtrace==2.3.0 (pinned in dbt-bigquery/hatch.toml) fails to build on Python 3.13 due to Cython compilation errors:

Error compiling Cython file:
    if PyInt_Check(n):
       ^
ddtrace/internal/_encoding.pyx:119:7: undeclared name not builtin: PyInt_Check

PyInt_Check was removed in CPython 3.13 as part of the ongoing cleanup of legacy C API symbols. ddtrace==2.3.0 was released in November 2023, before Python 3.13 existed.

This prevents running hatch run unit-tests (or any hatch environment setup) on Python 3.13, which is now the default on many systems.

Affected packages

All adapter packages that pin ddtrace==2.3.0 in their hatch.toml:

  • dbt-bigquery

(Other adapters may be affected too — I only checked dbt-bigquery.)

Workaround

Use Python 3.12 explicitly:

HATCH_PYTHON=python3.12 uvx hatch run unit-tests

Suggested fix

Upgrade ddtrace to a version that supports Python 3.13 (ddtrace 2.14.0+ added 3.13 support), or make it optional so unit tests can run without it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions