Skip to content

Commit

Permalink
Merge branch 'main' of github.com:open-telemetry/opentelemetry-python…
Browse files Browse the repository at this point in the history
…-contrib into python-upstream
  • Loading branch information
povilasv committed Apr 15, 2024
2 parents 236fba7 + a5c4887 commit 1f491a6
Show file tree
Hide file tree
Showing 255 changed files with 7,992 additions and 803 deletions.
123 changes: 123 additions & 0 deletions .github/workflows/instrumentations_0.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: Contrib Repo Tests

on:
push:
branches-ignore:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2

jobs:
instrumentations-0:
env:
# We use these variables to convert between tox and GHA version literals
py38: 3.8
py39: 3.9
py310: "3.10"
py311: "3.11"
pypy3: pypy-3.8
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [py38, py39, py310, py311, pypy3]
package:
# Do not add more instrumentations here, add them in instrumentations_1.yml.
# The reason for this separation of instrumentations into more than one YAML file is
# the limit of jobs that can be run from a Github actions matrix:
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
# "A matrix will generate a maximum of 256 jobs per workflow run. This limit applies
# to both GitHub-hosted and self-hosted runners."
- "aiohttp-client"
- "aiohttp-server"
- "aiopg"
- "aio-pika"
- "asgi"
- "asyncpg"
- "aws-lambda"
- "boto"
- "boto3sqs"
- "botocore"
- "cassandra"
- "celery"
- "confluent-kafka"
- "dbapi"
- "django"
- "elasticsearch"
- "falcon"
- "fastapi"
- "flask"
- "grpc"
- "httpx"
- "jinja2"
- "kafka-python"
- "logging"
- "mysql"
- "mysqlclient"
- "sio-pika"
- "psycopg2"
- "pymemcache"
- "pymongo"
- "pymysql"
- "pyramid"
- "redis"
- "remoulade"
- "requests"
- "sklearn"
- "sqlalchemy"
- "sqlite3"
- "starlette"
- "system-metrics"
- "tornado"
- "tortoiseorm"
os: [ubuntu-20.04]
exclude:
- python-version: py39
package: "sklearn"
- python-version: py310
package: "sklearn"
- python-version: py311
package: "sklearn"
- python-version: pypy3
package: "aiopg"
- python-version: pypy3
package: "asyncpg"
- python-version: pypy3
package: "boto"
- python-version: pypy3
package: "boto3sqs"
- python-version: pypy3
package: "botocore"
- python-version: pypy3
package: "psycopg2"
- python-version: pypy3
package: "remoulade"
- python-version: pypy3
package: "requests"
- python-version: pypy3
package: "sklearn"
- python-version: pypy3
package: "confluent-kafka"
- python-version: pypy3
package: "grpc"
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v4
with:
python-version: ${{ env[matrix.python-version] }}
- name: Install tox
run: pip install tox
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v1
with:
path: |
.tox
~/.cache/pip
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
62 changes: 62 additions & 0 deletions .github/workflows/instrumentations_1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Contrib Repo Tests

on:
push:
branches-ignore:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2

jobs:
instrumentations-1:
env:
# We use these variables to convert between tox and GHA version literals
py38: 3.8
py39: 3.9
py310: "3.10"
py311: "3.11"
pypy3: pypy-3.8
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
python-version: [py38, py39, py310, py311, pypy3]
package:
- "urllib"
- "urllib3"
- "wsgi"
- "distro"
- "richconsole"
- "psycopg"
- "prometheus-remote-write"
- "sdk-extension-aws"
- "propagator-aws-xray"
- "propagator-ot-trace"
- "resource-detector-container"
os: [ubuntu-20.04]
exclude:
- python-version: py311
package: "prometheus-remote-write"
- python-version: pypy3
package: "prometheus-remote-write"
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v2
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v4
with:
python-version: ${{ env[matrix.python-version] }}
- name: Install tox
run: pip install tox
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v1
with:
path: |
.tox
~/.cache/pip
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: run tox
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
2 changes: 1 addition & 1 deletion .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
with:
python-version: 3.9
- name: Install tox
run: pip install tox==3.27.1
run: pip install tox
- name: run tox
run: tox -e generate

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare-release-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
with:
python-version: 3.9
- name: Install tox
run: pip install tox==3.27.1
run: pip install tox
- name: run tox
run: tox -e generate

Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
with:
python-version: 3.9
- name: Install tox
run: pip install tox==3.27.1
run: pip install tox
- name: run tox
run: tox -e generate

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ jobs:
echo "PRIOR_VERSION_WHEN_PATCH=$prior_version_when_patch" >> $GITHUB_ENV
# check out main branch to verify there won't be problems with merging the change log
# at the end of this workflow
- uses: actions/checkout@v3
with:
ref: main

- run: |
if [[ -z $PRIOR_VERSION_WHEN_PATCH ]]; then
# not making a patch release
Expand All @@ -60,13 +54,19 @@ jobs:
fi
fi
# check out main branch to verify there won't be problems with merging the change log
# at the end of this workflow
- uses: actions/checkout@v3
with:
ref: main

# back to the release branch
- uses: actions/checkout@v3

# next few steps publish to pypi
- uses: actions/setup-python@v1
with:
python-version: '3.7'
python-version: '3.8'

- name: Build wheels
run: ./scripts/build.sh
Expand Down Expand Up @@ -202,4 +202,4 @@ jobs:
gh pr create --title "$message" \
--body "$body" \
--head $branch \
--base main
--base main
14 changes: 4 additions & 10 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-whitelist=
extension-pkg-whitelist=cassandra

# Add list of files or directories to be excluded. They should be base names, not
# paths.
Expand All @@ -29,7 +29,7 @@ limit-inference-results=100

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
load-plugins=pylint.extensions.no_self_use

# Pickle collected data for later comparisons.
persistent=yes
Expand Down Expand Up @@ -69,7 +69,6 @@ disable=missing-docstring,
duplicate-code,
ungrouped-imports, # Leave this up to isort
wrong-import-order, # Leave this up to isort
bad-continuation, # Leave this up to black
line-too-long, # Leave this up to black
exec-used,
super-with-arguments, # temp-pylint-upgrade
Expand All @@ -81,6 +80,8 @@ disable=missing-docstring,
invalid-overridden-method, # temp-pylint-upgrade
missing-module-docstring, # temp-pylint-upgrade
import-error, # needed as a workaround as reported here: https://github.com/open-telemetry/opentelemetry-python-contrib/issues/290
cyclic-import,
not-context-manager

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -268,13 +269,6 @@ max-line-length=79
# Maximum number of lines in a module.
max-module-lines=1000

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator

# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no
Expand Down
Loading

0 comments on commit 1f491a6

Please sign in to comment.