Skip to content

Commit 1377246

Browse files
committed
WIP
1 parent da78275 commit 1377246

19 files changed

+266
-58
lines changed

.codespellrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[codespell]
22
# skipping auto generated folders
3-
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv
3+
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,*-requirements*.txt
44
ignore-words-list = ot

.github/workflows/instrumentations_0.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ jobs:
127127
~/.cache/pip
128128
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
129129
- name: run tox
130-
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
130+
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra

.github/workflows/instrumentations_1.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ jobs:
3232
- "richconsole"
3333
- "psycopg"
3434
- "prometheus-remote-write"
35-
- "sdk-extension-aws"
3635
- "propagator-aws-xray"
3736
- "propagator-ot-trace"
38-
- "resource-detector-container"
3937
os: [ubuntu-20.04]
4038
exclude:
4139
- python-version: pypy3
@@ -58,4 +56,4 @@ jobs:
5856
~/.cache/pip
5957
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
6058
- name: run tox
61-
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra --benchmark-json=${{ env.RUN_MATRIX_COMBINATION }}-benchmark.json
59+
run: tox -f ${{ matrix.python-version }}-${{ matrix.package }} -- -ra

.github/workflows/lint.yml

-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ jobs:
6868
- "processor-baggage"
6969
- "propagator-aws-xray"
7070
- "propagator-ot-trace"
71-
- "resource-detector-container"
72-
- "sdk-extension-aws"
7371
os: [ubuntu-20.04]
7472
runs-on: ubuntu-20.04
7573
steps:

.github/workflows/lint_1.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: lint 1
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'release/*'
7+
pull_request:
8+
env:
9+
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2
10+
11+
jobs:
12+
test-1:
13+
env:
14+
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
18+
matrix:
19+
package:
20+
- "resource/opentelemetry-resource-detector-container"
21+
- "sdk-extension/opentelemetry-sdk-extension-aws"
22+
os: [ubuntu-20.04]
23+
steps:
24+
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
25+
uses: actions/checkout@v4
26+
- name: Set up Python ${{ env[matrix.python-version] }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.11"
30+
- name: Install tox
31+
run: pip install tox
32+
- name: Cache tox environment
33+
# Preserves .tox directory between runs for faster installs
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
.tox
38+
~/.cache/pip
39+
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
40+
- name: run tox
41+
run: tox -c ${{ matrix.package }}/tox.ini -e lint

.github/workflows/spellcheck_1.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: spellcheck 1
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'release/*'
7+
pull_request:
8+
env:
9+
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2
10+
11+
jobs:
12+
test-1:
13+
env:
14+
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
18+
matrix:
19+
package:
20+
- "resource/opentelemetry-resource-detector-container"
21+
- "sdk-extension/opentelemetry-sdk-extension-aws"
22+
os: [ubuntu-20.04]
23+
steps:
24+
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
25+
uses: actions/checkout@v4
26+
- name: Set up Python ${{ env[matrix.python-version] }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.11"
30+
- name: Install tox
31+
run: pip install tox
32+
- name: Cache tox environment
33+
# Preserves .tox directory between runs for faster installs
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
.tox
38+
~/.cache/pip
39+
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
40+
- name: run tox
41+
run: tox -c ${{ matrix.package }}/tox.ini -e spellcheck

.github/workflows/test_1.yml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: test 1
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'release/*'
7+
pull_request:
8+
env:
9+
CORE_REPO_SHA: 955c92e91b5cd4bcfb43c39efcef086b040471d2
10+
11+
jobs:
12+
test-1:
13+
env:
14+
py38: 3.8
15+
py39: 3.9
16+
py310: "3.10"
17+
py311: "3.11"
18+
pypy3: pypy-3.8
19+
RUN_MATRIX_COMBINATION: ${{ matrix.python-version }}-${{ matrix.package }}-${{ matrix.os }}
20+
runs-on: ${{ matrix.os }}
21+
strategy:
22+
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
23+
matrix:
24+
python-version: [py38, py39, py310, py311, pypy3]
25+
package:
26+
- "resource/opentelemetry-resource-detector-container"
27+
- "sdk-extension/opentelemetry-sdk-extension-aws"
28+
os: [ubuntu-20.04]
29+
exclude:
30+
- python-version: py311
31+
package: "prometheus-remote-write"
32+
- python-version: pypy3
33+
package: "prometheus-remote-write"
34+
steps:
35+
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
36+
uses: actions/checkout@v4
37+
- name: Set up Python ${{ env[matrix.python-version] }}
38+
uses: actions/setup-python@v5
39+
with:
40+
python-version: ${{ env[matrix.python-version] }}
41+
- name: Install tox
42+
run: pip install tox
43+
- name: Cache tox environment
44+
# Preserves .tox directory between runs for faster installs
45+
uses: actions/cache@v4
46+
with:
47+
path: |
48+
.tox
49+
~/.cache/pip
50+
key: v7-build-tox-cache-${{ env.RUN_MATRIX_COMBINATION }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
51+
- name: run tox
52+
run: tox -c ${{ matrix.package }}/tox.ini -e test-${{ matrix.python-version }} -- -ra

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ venv*/
2727
# Installer logs
2828
pip-log.txt
2929

30-
# Unit test / coverage reports
30+
# Unit test / coverage, benchmark reports
3131
coverage.xml
3232
.coverage
3333
.nox
3434
.tox
3535
.cache
3636
htmlcov
37+
benchmark.json
3738

3839
# Translations
3940
*.mo

.isort.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ profile=black
1414
; docs: https://github.com/timothycrosley/isort#multi-line-output-modes
1515
multi_line_output=3
1616
skip=target
17-
skip_glob=**/gen/*,.venv*/*,venv*/*,.tox/*
17+
skip_glob=**/gen/*,.venv*/*,venv*/*,.tox/*,**/.tox/*
1818
known_first_party=opentelemetry
1919
known_third_party=psutil,pytest,redis,redis_opentracing

coverage-requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coverage==7.5.1
2+
pytest-cov==5.0.0

lint-requirements.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
astroid==3.1.0
2+
black==24.4.2
3+
click==8.1.7
4+
Deprecated==1.2.14
5+
dill==0.3.8
6+
flake8==7.0.0
7+
importlib-metadata==7.0.0
8+
isort==5.13.2
9+
mccabe==0.7.0
10+
mypy-extensions==1.0.0
11+
packaging==24.0
12+
pathspec==0.12.1
13+
platformdirs==4.2.1
14+
pycodestyle==2.11.1
15+
pyflakes==3.2.0
16+
pylint==3.1.0
17+
tomlkit==0.12.4
18+
typing_extensions==4.11.0
19+
wrapt==1.16.0
20+
zipp==3.18.1

resource/opentelemetry-resource-detector-container/test-requirements.txt

-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ packaging==24.0
66
pluggy==1.5.0
77
py-cpuinfo==9.0.0
88
pytest==7.4.4
9-
pytest-benchmark==4.0.0
109
tomli==2.0.1
1110
typing_extensions==4.10.0
1211
wrapt==1.16.0
1312
zipp==3.17.0
14-
-e resource/opentelemetry-resource-detector-container
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[tox]
2+
isolated_build = True
3+
skipsdist = True
4+
skip_missing_interpreters = True
5+
envlist =
6+
test-py3{8,9,10,11}
7+
test-pypy3
8+
lint
9+
coverage
10+
spellcheck
11+
12+
[testenv]
13+
setenv =
14+
; override CORE_REPO_SHA via env variable when testing other branches/commits than main
15+
; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test>
16+
CORE_REPO_SHA={env:CORE_REPO_SHA:main}
17+
CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}
18+
19+
commands_pre =
20+
test,lint,coverage: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
21+
test,lint,coverage: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
22+
test,lint,coverage: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
23+
test,lint,coverage: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
24+
test,lint,coverage: pip install -e .
25+
26+
test,coverage: pip install -r {toxinidir}/test-requirements.txt
27+
28+
lint: pip install -r {toxinidir}/../../lint-requirements.txt
29+
30+
coverage: pip install -r {toxinidir}/../../coverage-requirements.txt
31+
32+
spellcheck: pip install -r {toxinidir}/../../spellcheck-requirements.txt
33+
34+
commands =
35+
test: pytest {toxinidir}/tests {posargs}
36+
37+
lint: black --diff --check --config {toxinidir}/../../pyproject.toml {toxinidir}
38+
lint: isort --diff --check-only --settings-path {toxinidir}/../../.isort.cfg {toxinidir}
39+
lint: flake8 --config {toxinidir}/../../.flake8 {toxinidir}
40+
lint: pylint --rcfile={toxinidir}/../../.pylintrc {toxinidir}/src/opentelemetry
41+
lint: pylint --rcfile={toxinidir}/../../.pylintrc {toxinidir}/tests
42+
43+
coverage: coverage erase
44+
coverage: pytest --cov={toxinidir}/src --cov-append --cov-branch --cov-report='' {toxinidir}/tests
45+
coverage: coverage report --show-missing
46+
coverage: coverage xml
47+
48+
spellcheck: codespell --config {toxinidir}/../../.codespellrc {toxinidir}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest-benchmark==4.0.0

sdk-extension/opentelemetry-sdk-extension-aws/test-requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ packaging==24.0
66
pluggy==1.5.0
77
py-cpuinfo==9.0.0
88
pytest==7.4.4
9-
pytest-benchmark==4.0.0
9+
pytest==7.1.3
1010
tomli==2.0.1
1111
typing_extensions==4.10.0
1212
wrapt==1.16.0
1313
zipp==3.17.0
14-
-e sdk-extension/opentelemetry-sdk-extension-aws
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[tox]
2+
isolated_build = True
3+
skipsdist = True
4+
skip_missing_interpreters = True
5+
envlist =
6+
test-py3{8,9,10,11}
7+
test-pypy3
8+
lint
9+
coverage
10+
spellcheck
11+
12+
[testenv]
13+
setenv =
14+
; override CORE_REPO_SHA via env variable when testing other branches/commits than main
15+
; i.e: CORE_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test>
16+
CORE_REPO_SHA={env:CORE_REPO_SHA:main}
17+
CORE_REPO=git+https://github.com/open-telemetry/opentelemetry-python.git@{env:CORE_REPO_SHA}
18+
19+
commands_pre =
20+
test,lint,coverage,benchmark: pip install opentelemetry-api@{env:CORE_REPO}\#egg=opentelemetry-api&subdirectory=opentelemetry-api
21+
test,lint,coverage,benchmark: pip install opentelemetry-semantic-conventions@{env:CORE_REPO}\#egg=opentelemetry-semantic-conventions&subdirectory=opentelemetry-semantic-conventions
22+
test,lint,coverage,benchmark: pip install opentelemetry-sdk@{env:CORE_REPO}\#egg=opentelemetry-sdk&subdirectory=opentelemetry-sdk
23+
test,lint,coverage,benchmark: pip install opentelemetry-test-utils@{env:CORE_REPO}\#egg=opentelemetry-test-utils&subdirectory=tests/opentelemetry-test-utils
24+
test,lint,coverage,benchmark: pip install -e .
25+
26+
test,coverage,benchmark: pip install -r {toxinidir}/test-requirements.txt
27+
28+
lint: pip install -r {toxinidir}/../../lint-requirements.txt
29+
30+
coverage: pip install -r {toxinidir}/../../coverage-requirements.txt
31+
32+
spellcheck: pip install -r {toxinidir}/../../spellcheck-requirements.txt
33+
34+
benchmark: pip install -r {toxinidir}/benchmark-requirements.txt
35+
36+
commands =
37+
test: pytest {toxinidir}/tests {posargs}
38+
39+
lint: black --diff --check --config {toxinidir}/../../pyproject.toml {toxinidir}
40+
lint: isort --diff --check-only --settings-path {toxinidir}/../../.isort.cfg {toxinidir}
41+
lint: flake8 --config {toxinidir}/../../.flake8 {toxinidir}
42+
lint: pylint --rcfile={toxinidir}/../../.pylintrc {toxinidir}/src/opentelemetry
43+
lint: pylint --rcfile={toxinidir}/../../.pylintrc {toxinidir}/tests
44+
45+
coverage: coverage erase
46+
coverage: pytest --cov={toxinidir}/src --cov-append --cov-branch --cov-report='' {toxinidir}/tests
47+
coverage: coverage report --show-missing
48+
coverage: coverage xml
49+
50+
spellcheck: codespell --config {toxinidir}/../../.codespellrc {toxinidir}
51+
52+
benchmark: pytest {toxinidir}/benchmarks --benchmark-json=benchmark.json

spellcheck-requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
codespell==2.2.6

0 commit comments

Comments
 (0)