Skip to content

chore(internal): move rate limiter to PyO3 #26188

chore(internal): move rate limiter to PyO3

chore(internal): move rate limiter to PyO3 #26188

Workflow file for this run

name: Build
on:
push:
branches:
- '[0-9].[0-9]*'
- '[0-9].x'
# special branches used to test this workflow
# before merging/releasing
- build_deploy*
pull_request:
release:
types:
- published
workflow_dispatch:
# Allow manually triggering, but do NOT upload the result
schedule:
# Nightly builds after weekdays
- cron: 0 2 * * 2-6
jobs:
build_wheels_py37:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp37*'
build_wheels_py38:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp38*'
build_wheels_py39:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp39*'
build_wheels_py310:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp310*'
build_wheels_py311:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp311*'
build_wheels_py312:
uses: ./.github/workflows/build_python_3.yml
with:
cibw_build: 'cp312*'
cibw_prerelease_pythons: 'True'
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Include all history and tags
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.7'
- name: Build sdist
run: |
pip install cython cmake
python setup.py sdist
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz
test_alpine_sdist:
# alpine is the only environment not built/tested by cibuildwheel
name: Test source distribution on Alpine Linux
needs: [build_sdist]
runs-on: ubuntu-latest
container:
image: python:3.9-alpine
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Install build dependencies
# Rust + Cargo are needed for Cryptography
run: apk add git gcc g++ musl-dev libffi-dev openssl-dev bash rust cargo make cmake
- name: Check source package
run: |
pip install twine readme_renderer[md]
twine check dist/*.tar.gz
- name: Install source package
run: pip install dist/*.tar.gz
- name: Test the source package
run: python $GITHUB_WORKSPACE/tests/smoke_test.py
# Move out of the workspace to avoid importing ddtrace from the source
working-directory: /
upload_pypi:
needs:
- build_wheels_py37
- build_wheels_py38
- build_wheels_py39
- build_wheels_py310
- build_wheels_py311
- build_wheels_py312
- test_alpine_sdist
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
# To test: repository_url: https://test.pypi.org/legacy/
# Setting skip_existing will prevent the deploy from erring out early
# due to a duplicate wheel being present which will ensure that the rest
# of the wheels will be uploaded if some are uploaded manually.
skip_existing: true
build-and-publish-init-image:
needs: [upload_pypi]
uses: ./.github/workflows/lib-inject-publish.yml
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
with:
ddtrace-version: ${{ github.ref_name }}
image-tag: ${{ github.ref_name }}