|
| 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 |
0 commit comments