Skip to content

Commit

Permalink
ci: test with Python 3.13 (#10821)
Browse files Browse the repository at this point in the history
This change adjusts CI and the library itself to work under Python 3.13.
Any tests that failed under 3.13 are skipped on 3.13 for now and will be
unskipped in a future change.

## Checklist
- [x] PR author has checked that all the criteria below are met
- The PR description includes an overview of the change
- The PR description articulates the motivation for the change
- The change includes tests OR the PR description describes a testing
strategy
- The PR description notes risks associated with the change, if any
- Newly-added code is easy to change
- The change follows the [library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
- The change includes or references documentation updates if necessary
- Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))

## Reviewer Checklist
- [x] Reviewer has checked that all the criteria below are met 
- Title is accurate
- All changes are related to the pull request's stated goal
- Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- Testing strategy adequately addresses listed risks
- Newly-added code is easy to change
- Release note makes sense to a user of the library
- If necessary, author has acknowledged and discussed the performance
implications of this PR as reported in the benchmarks PR comment
- Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

---------

Co-authored-by: Emmett Butler <[email protected]>
Co-authored-by: Gabriele N. Tornetta <[email protected]>
Co-authored-by: Emmett Butler <[email protected]>
Co-authored-by: Federico Mon <[email protected]>
Co-authored-by: erikayasuda <[email protected]>
Co-authored-by: Gabriele N. Tornetta <[email protected]>
  • Loading branch information
7 people authored Dec 18, 2024
1 parent e46e3b5 commit c7b888d
Show file tree
Hide file tree
Showing 158 changed files with 3,540 additions and 284 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
build_wheels:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp37* cp38* cp39* cp310* cp311* cp312*'
cibw_build: 'cp37* cp38* cp39* cp310* cp311* cp312* cp313*'

build_sdist:
name: Build source distribution
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/build_python_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: '3.8'
- run: pip install cibuildwheel==2.16.5
- run: pip install cibuildwheel==2.22.0
- id: set-matrix
env:
CIBW_BUILD: ${{ inputs.cibw_build }}
Expand All @@ -34,7 +34,7 @@ jobs:
{
cibuildwheel --print-build-identifiers --platform linux --arch x86_64,i686 | jq -cR '{only: ., os: "ubuntu-latest"}' \
&& cibuildwheel --print-build-identifiers --platform linux --arch aarch64 | jq -cR '{only: ., os: "arm-4core-linux"}' \
&& cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | jq -cR '{only: ., os: "windows-latest"}' \
&& cibuildwheel --print-build-identifiers --platform windows --arch AMD64,x86 | grep -v 313 | jq -cR '{only: ., os: "windows-latest"}' \
&& cibuildwheel --print-build-identifiers --platform macos --arch x86_64,universal2 | jq -cR '{only: ., os: "macos-13"}'
} | jq -sc
)
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:

- name: Build wheels arm64
if: always() && matrix.os == 'arm-4core-linux'
run: /home/runner/.local/bin/pipx run cibuildwheel==2.16.5 --only ${{ matrix.only }}
run: /home/runner/.local/bin/pipx run cibuildwheel==2.22.0 --only ${{ matrix.only }}
env:
CIBW_SKIP: ${{ inputs.cibw_skip }}
CIBW_PRERELEASE_PYTHONS: ${{ inputs.cibw_prerelease_pythons }}
Expand All @@ -107,7 +107,7 @@ jobs:
rm -rf ./tempwheelhouse
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx &&
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS:
choco install -y 7zip &&
7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx &&
Expand All @@ -117,7 +117,7 @@ jobs:

- name: Build wheels
if: always() && matrix.os != 'arm-4core-linux'
uses: pypa/cibuildwheel@v2.16.5
uses: pypa/cibuildwheel@v2.22.0
with:
only: ${{ matrix.only }}
env:
Expand All @@ -143,7 +143,7 @@ jobs:
rm -rf ./tempwheelhouse
CIBW_REPAIR_WHEEL_COMMAND_MACOS: |
zip -d {wheel} \*.c \*.cpp \*.cc \*.h \*.hpp \*.pyx &&
delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
MACOSX_DEPLOYMENT_TARGET=12.7 delocate-wheel --require-archs {delocate_archs} -w {dest_dir} -v {wheel}
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS:
choco install -y 7zip &&
7z d -r "{wheel}" *.c *.cpp *.cc *.h *.hpp *.pyx &&
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/generate-package-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ jobs:
with:
python-version: "3.12"

- name: Setup Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/requirements-locks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
validate:
name: Check requirements lockfiles
runs-on: ubuntu-latest
container: ghcr.io/datadog/dd-trace-py/testrunner:47c7b5287da25643e46652e6d222a40a52f2382a@sha256:3a02dafeff9cd72966978816d1b39b54f5517af4049396923b95c8452f604269
container: ghcr.io/datadog/dd-trace-py/testrunner:0a50e839f4b1600f02157518b8d016451b346578@sha256:5dae9bc7872f69b31b612690f0748c7ad71ab90ef28a754b2ae93d0ba505837b
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -23,7 +23,7 @@ jobs:
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Set python interpreters
run: pyenv global 3.10 3.7 3.8 3.9 3.11 3.12
run: pyenv global 3.10 3.7 3.8 3.9 3.11 3.12 3.13

- name: Install Dependencies
run: pip install --upgrade pip && pip install riot==0.20.1
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/download-dependency-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export PYTHONUNBUFFERED=TRUE
--local-ddtrace \
--arch x86_64 \
--arch aarch64 \
--platform musllinux_1_1 \
--platform musllinux_1_2 \
--platform manylinux2014 \
--output-dir ../pywheels-dep \
--verbose
21 changes: 21 additions & 0 deletions .gitlab/package.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
build_base_venvs:
extends: .testrunner
stage: package
parallel:
matrix:
- PYTHON_VERSION: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
variables:
CMAKE_BUILD_PARALLEL_LEVEL: 12
PIP_VERBOSE: 1
script:
- pip install riot==0.20.0
- riot -P -v generate --python=$PYTHON_VERSION
artifacts:
name: venv_$PYTHON_VERSION
paths:
- .riot/venv_*
- ddtrace/**/*.so*
- ddtrace/internal/datadog/profiling/crashtracker/crashtracker_exe*

download_ddtrace_artifacts:
image: registry.ddbuild.io/github-cli:v27480869-eafb11d-2.43.0
tags: [ "arch:amd64" ]
Expand Down Expand Up @@ -31,6 +50,8 @@ download_dependency_wheels:
PYTHON_VERSION: "3.11"
- PYTHON_IMAGE_TAG: "3.12.0"
PYTHON_VERSION: "3.12"
- PYTHON_IMAGE_TAG: "3.13.0"
PYTHON_VERSION: "3.13"
script:
- .gitlab/download-dependency-wheels.sh
artifacts:
Expand Down
4 changes: 2 additions & 2 deletions .gitlab/testrunner.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
.testrunner:
image: registry.ddbuild.io/images/mirror/dd-trace-py/testrunner:47c7b5287da25643e46652e6d222a40a52f2382a@sha256:3a02dafeff9cd72966978816d1b39b54f5517af4049396923b95c8452f604269
image: registry.ddbuild.io/images/mirror/dd-trace-py/testrunner:0a50e839f4b1600f02157518b8d016451b346578@sha256:5dae9bc7872f69b31b612690f0748c7ad71ab90ef28a754b2ae93d0ba505837b
# DEV: we have a larger pool of amd64 runners, prefer that over arm64
tags: [ "arch:amd64" ]
timeout: 20m
before_script:
- ulimit -c unlimited
- pyenv global 3.12 3.7 3.8 3.9 3.10 3.11 3.13-dev
- pyenv global 3.12 3.7 3.8 3.9 3.10 3.11 3.13
- export _CI_DD_AGENT_URL=http://${HOST_IP}:8126/
6 changes: 3 additions & 3 deletions .gitlab/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ variables:
# CI_DEBUG_SERVICES: "true"

.testrunner:
image: registry.ddbuild.io/images/mirror/dd-trace-py/testrunner:47c7b5287da25643e46652e6d222a40a52f2382a@sha256:3a02dafeff9cd72966978816d1b39b54f5517af4049396923b95c8452f604269
image: registry.ddbuild.io/images/mirror/dd-trace-py/testrunner:0a50e839f4b1600f02157518b8d016451b346578@sha256:5dae9bc7872f69b31b612690f0748c7ad71ab90ef28a754b2ae93d0ba505837b
# DEV: we have a larger pool of amd64 runners, prefer that over arm64
tags: [ "arch:amd64" ]
timeout: 20m
before_script:
- pyenv global 3.12 3.7 3.8 3.9 3.10 3.11 3.13-dev
- pyenv global 3.12 3.7 3.8 3.9 3.10 3.11 3.13
- export _CI_DD_AGENT_URL=http://${HOST_IP}:8126/


Expand Down Expand Up @@ -62,7 +62,7 @@ build_base_venvs:
stage: riot
parallel:
matrix:
- PYTHON_VERSION: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
- PYTHON_VERSION: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
variables:
CMAKE_BUILD_PARALLEL_LEVEL: 12
PIP_VERBOSE: 1
Expand Down
20 changes: 20 additions & 0 deletions .riot/requirements/102dfdd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/102dfdd.in
#
attrs==24.2.0
coverage[toml]==7.6.1
hypothesis==6.45.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
structlog==20.2.0
25 changes: 25 additions & 0 deletions .riot/requirements/104daf8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/104daf8.in
#
attrs==24.2.0
certifi==2024.8.30
charset-normalizer==3.3.2
coverage[toml]==7.6.1
hypothesis==6.45.0
idna==3.10
iniconfig==2.0.0
mock==5.1.0
opensearch-py[requests]==1.1.0
opentracing==2.4.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
requests==2.32.3
sortedcontainers==2.4.0
urllib3==1.26.20
20 changes: 20 additions & 0 deletions .riot/requirements/104f450.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/104f450.in
#
attrs==24.2.0
coverage[toml]==7.6.1
hypothesis==6.45.0
iniconfig==2.0.0
logbook==1.0.0
mock==5.1.0
opentracing==2.4.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
26 changes: 26 additions & 0 deletions .riot/requirements/1053dce.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1053dce.in
#
attrs==24.2.0
coverage[toml]==7.6.1
gevent==24.2.1
greenlet==3.1.1
hypothesis==6.45.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
zope-event==5.0
zope-interface==7.0.3

# The following packages are considered to be unsafe in a requirements file:
setuptools==75.1.0
29 changes: 29 additions & 0 deletions .riot/requirements/114bad8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/114bad8.in
#
attrs==24.2.0
blinker==1.8.2
click==8.1.7
coverage[toml]==7.6.1
flask==3.0.3
flask-caching==1.10.1
hypothesis==6.45.0
iniconfig==2.0.0
itsdangerous==2.2.0
jinja2==3.1.4
markupsafe==2.1.5
mock==5.1.0
opentracing==2.4.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
python-memcached==1.62
redis==5.1.1
sortedcontainers==2.4.0
werkzeug==3.0.4
38 changes: 38 additions & 0 deletions .riot/requirements/11f2bd0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/11f2bd0.in
#
annotated-types==0.7.0
attrs==24.2.0
blinker==1.8.2
certifi==2024.8.30
charset-normalizer==3.3.2
click==8.1.7
coverage[toml]==7.6.1
flask==2.3.3
flask-openapi3==4.0.1
hypothesis==6.45.0
idna==3.10
importlib-metadata==8.5.0
iniconfig==2.0.0
itsdangerous==2.2.0
jinja2==3.1.4
markupsafe==2.1.5
mock==5.1.0
opentracing==2.4.0
packaging==24.1
pluggy==1.5.0
pydantic==2.9.2
pydantic-core==2.23.4
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
requests==2.32.3
sortedcontainers==2.4.0
typing-extensions==4.12.2
urllib3==1.26.20
werkzeug==2.3.8
zipp==3.20.2
19 changes: 19 additions & 0 deletions .riot/requirements/11fd02a.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/11fd02a.in
#
attrs==24.2.0
coverage[toml]==7.6.1
hypothesis==6.45.0
iniconfig==2.0.0
mock==5.1.0
opentracing==2.4.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
31 changes: 31 additions & 0 deletions .riot/requirements/1261ed3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# This file is autogenerated by pip-compile with Python 3.13
# by the following command:
#
# pip-compile --allow-unsafe --no-annotate .riot/requirements/1261ed3.in
#
aiohappyeyeballs==2.4.3
aiohttp==3.10.9
aiohttp-jinja2==1.5.1
aiosignal==1.3.1
attrs==24.2.0
coverage[toml]==7.6.1
frozenlist==1.4.1
hypothesis==6.45.0
idna==3.10
iniconfig==2.0.0
jinja2==3.1.4
markupsafe==2.1.5
mock==5.1.0
multidict==6.1.0
opentracing==2.4.0
packaging==24.1
pluggy==1.5.0
pytest==8.3.3
pytest-aiohttp==1.0.5
pytest-asyncio==0.23.7
pytest-cov==5.0.0
pytest-mock==3.14.0
pytest-randomly==3.15.0
sortedcontainers==2.4.0
yarl==1.13.1
Loading

0 comments on commit c7b888d

Please sign in to comment.