diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 81f7bb40799..d7c7e0b8011 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -176,6 +176,25 @@ jobs: - name: Run tests run: tox -e lint-opentelemetry-opentracing-shim + lint-opentelemetry-opentracing-example: + name: opentelemetry-opentracing-example + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - name: Checkout repo @ SHA - ${{ github.sha }} + uses: actions/checkout@v4 + + - name: Set up Python 3.14 + uses: actions/setup-python@v5 + with: + python-version: "3.14" + + - name: Install tox + run: pip install tox-uv + + - name: Run tests + run: tox -e lint-opentelemetry-opentracing-example + lint-opentelemetry-opencensus-shim: name: opentelemetry-opencensus-shim runs-on: ubuntu-latest diff --git a/docs/examples/opentracing/.pylintrc b/docs/examples/opentracing/.pylintrc new file mode 100644 index 00000000000..91f98df0b46 --- /dev/null +++ b/docs/examples/opentracing/.pylintrc @@ -0,0 +1,9 @@ +[MASTER] +init-hook='import sys; sys.path.insert(0, ".")' + +[MESSAGES CONTROL] +disable=missing-docstring, + too-few-public-methods + +[FORMAT] +expected-line-ending-format= \ No newline at end of file diff --git a/docs/examples/opentracing/rediscache.py b/docs/examples/opentracing/rediscache.py index 61025eac725..e6d9a1eca85 100644 --- a/docs/examples/opentracing/rediscache.py +++ b/docs/examples/opentracing/rediscache.py @@ -7,11 +7,8 @@ import pickle from functools import wraps -# FIXME The pylint disablings are needed here because the code of this -# example is being executed against the tox.ini of the main -# opentelemetry-python project. Find a way to separate the two. -import redis # pylint: disable=import-error -import redis_opentracing # pylint: disable=import-error +import redis +import redis_opentracing class RedisCache: diff --git a/tox.ini b/tox.ini index 20609551021..92e8530a41e 100644 --- a/tox.ini +++ b/tox.ini @@ -39,6 +39,7 @@ envlist = py3{9,10,11,12,13,14,14t}-test-opentelemetry-opentracing-shim pypy3-test-opentelemetry-opentracing-shim lint-opentelemetry-opentracing-shim + lint-opentelemetry-opentracing-example py3{9,10,11,12,13,14}-test-opentelemetry-opencensus-shim ; opencensus-shim intentionally excluded from pypy3 (grpcio install fails) @@ -408,3 +409,13 @@ deps = pre-commit commands = pre-commit run --color=always --all-files {posargs} + +[testenv:lint-opentelemetry-opentracing-example] +deps = + -r dev-requirements.txt + -r {toxinidir}/docs/examples/opentracing/requirements.txt +setenv = + PYTHONPATH = {toxinidir}/docs/examples/opentracing +commands = + pylint --rcfile {toxinidir}/docs/examples/opentracing/.pylintrc {toxinidir}/docs/examples/opentracing + \ No newline at end of file