Skip to content

Commit

Permalink
Merge branch 'master' into antonpirker/script-to-check-python-compati…
Browse files Browse the repository at this point in the history
…bility
  • Loading branch information
antonpirker authored Dec 5, 2024
2 parents 35c80e6 + 50ad148 commit b494239
Show file tree
Hide file tree
Showing 227 changed files with 8,935 additions and 2,053 deletions.
14 changes: 14 additions & 0 deletions .coveragerc36
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# This is the coverage.py config for Python 3.6
# The config for newer Python versions is in pyproject.toml.

[run]
branch = true
omit =
/tmp/*
*/tests/*
*/.venv/*


[report]
exclude_lines =
if TYPE_CHECKING:
35 changes: 27 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
with:
python-version: 3.12
Expand All @@ -39,7 +39,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
with:
python-version: 3.12
Expand All @@ -54,7 +54,7 @@ jobs:
timeout-minutes: 10

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
with:
python-version: 3.12
Expand All @@ -70,19 +70,22 @@ jobs:
# This will also trigger "make dist" that creates the Python packages
make aws-lambda-layer
- name: Upload Python Packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ github.sha }}
name: artifact-build_lambda_layer
path: |
dist/*
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

docs:
name: Build SDK API Doc
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
with:
python-version: 3.12
Expand All @@ -91,7 +94,23 @@ jobs:
make apidocs
cd docs/_build && zip -r gh-pages ./
- uses: actions/upload-artifact@v3.1.1
- uses: actions/upload-artifact@v4
with:
name: artifact-docs
path: |
docs/_build/gh-pages.zip
if-no-files-found: 'error'
# since this artifact will be merged, compression is not necessary
compression-level: '0'

merge:
name: Create Release Artifact
runs-on: ubuntu-latest
needs: [build_lambda_layer, docs]
steps:
- uses: actions/upload-artifact/merge@v4
with:
# Craft expects release assets from github to be a single artifact named after the sha.
name: ${{ github.sha }}
path: docs/_build/gh-pages.zip
pattern: artifact-*
delete-merged: true
12 changes: 7 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ on:
- master
- sentry-sdk-2.0
pull_request:
# The branches below must be a subset of the branches above
branches:
- master
- sentry-sdk-2.0
schedule:
- cron: '18 18 * * 3'

# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

Expand All @@ -46,7 +48,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.7
uses: actions/checkout@v4.2.2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/enforce-license-compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ on:
- release/*
- sentry-sdk-2.0
pull_request:
branches:
- master
- main
- sentry-sdk-2.0

# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}

jobs:
enforce-license-compliance:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
with:
token: ${{ secrets.GH_RELEASE_PAT }}
fetch-depth: 0
Expand Down
46 changes: 33 additions & 13 deletions .github/workflows/test-integrations-ai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.9","3.11","3.12"]
python-version: ["3.7","3.9","3.11","3.12","3.13"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -65,38 +65,48 @@ jobs:
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub-latest"
- name: Generate coverage XML (Python 3.6)
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
run: |
export COVERAGE_RCFILE=.coveragerc36
coverage combine .coverage-sentry-*
coverage xml --ignore-errors
- name: Generate coverage XML
if: ${{ !cancelled() }}
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
run: |
coverage combine .coverage*
coverage xml -i
coverage combine .coverage-sentry-*
coverage xml
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v4.5.0
uses: codecov/codecov-action@v5.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
# make sure no plugins alter our coverage reports
plugin: noop
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: .junitxml
verbose: true
test-ai-pinned:
name: AI (pinned)
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.7","3.9","3.11","3.12"]
python-version: ["3.8","3.9","3.11","3.12","3.13"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
Expand Down Expand Up @@ -127,25 +137,35 @@ jobs:
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-huggingface_hub"
- name: Generate coverage XML (Python 3.6)
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
run: |
export COVERAGE_RCFILE=.coveragerc36
coverage combine .coverage-sentry-*
coverage xml --ignore-errors
- name: Generate coverage XML
if: ${{ !cancelled() }}
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
run: |
coverage combine .coverage*
coverage xml -i
coverage combine .coverage-sentry-*
coverage xml
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v4.5.0
uses: codecov/codecov-action@v5.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
# make sure no plugins alter our coverage reports
plugin: noop
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: .junitxml
verbose: true
check_required_tests:
name: All AI tests passed
name: All pinned AI tests passed
needs: test-ai-pinned
# Always run this, even if a dependent job failed
if: always()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Do not edit this file. This file is generated automatically by executing
# python scripts/split-tox-gh-actions/split-tox-gh-actions.py
name: Test AWS Lambda
name: Test AWS
on:
push:
branches:
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
name: permissions check
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
with:
persist-credentials: false
- name: Check permissions on PR
Expand All @@ -52,8 +52,8 @@ jobs:
- name: Check permissions on repo branch
if: github.event_name == 'push'
run: true
test-aws_lambda-pinned:
name: AWS Lambda (pinned)
test-aws-pinned:
name: AWS (pinned)
timeout-minutes: 30
runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -67,7 +67,7 @@ jobs:
os: [ubuntu-20.04]
needs: check-permissions
steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- uses: actions/setup-python@v5
Expand All @@ -84,31 +84,41 @@ jobs:
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda"
- name: Generate coverage XML (Python 3.6)
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
run: |
export COVERAGE_RCFILE=.coveragerc36
coverage combine .coverage-sentry-*
coverage xml --ignore-errors
- name: Generate coverage XML
if: ${{ !cancelled() }}
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
run: |
coverage combine .coverage*
coverage xml -i
coverage combine .coverage-sentry-*
coverage xml
- name: Upload coverage to Codecov
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v4.5.0
uses: codecov/codecov-action@v5.0.7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
# make sure no plugins alter our coverage reports
plugin: noop
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: .junitxml
verbose: true
check_required_tests:
name: All AWS Lambda tests passed
needs: test-aws_lambda-pinned
name: All pinned AWS tests passed
needs: test-aws-pinned
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-20.04
steps:
- name: Check for failures
if: contains(needs.test-aws_lambda-pinned.result, 'failure') || contains(needs.test-aws_lambda-pinned.result, 'skipped')
if: contains(needs.test-aws-pinned.result, 'failure') || contains(needs.test-aws-pinned.result, 'skipped')
run: |
echo "One of the dependent jobs has failed. You may need to re-run it." && exit 1
Loading

0 comments on commit b494239

Please sign in to comment.