Skip to content

Commit

Permalink
Separate lint into several jobs
Browse files Browse the repository at this point in the history
Fixes #3893
  • Loading branch information
ocelotl committed May 6, 2024
1 parent 397e357 commit bb8118a
Show file tree
Hide file tree
Showing 26 changed files with 316 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[codespell]
# skipping auto generated folders
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git,./opentelemetry-semantic-conventions
skip = ./.tox,./.mypy_cache,./docs/_build,./target,*/LICENSE,./venv,.git,./opentelemetry-semantic-conventions,*-requirements*.txt
ignore-words-list = ans,ue,ot,hist,ro
56 changes: 56 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Lint tests

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

jobs:
lint-3_11:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
package:
- "opentelemetry-api"
- "opentelemetry-proto"
- "opentelemetry-sdk"
- "opentelemetry-semantic-conventions"
- "opentelemetry-getting-started"
- "opentelemetry-opentracing-shim"
- "opentelemetry-opencensus-shim"
- "opentelemetry-exporter-opencensus"
- "opentelemetry-exporter-otlp-proto-common"
- "opentelemetry-exporter-otlp-combined"
- "opentelemetry-exporter-otlp-proto-grpc"
- "opentelemetry-exporter-otlp-proto-http"
- "opentelemetry-exporter-otlp-proto-prometheus"
- "opentelemetry-exporter-otlp-proto-zipkin-combined"
- "opentelemetry-exporter-otlp-proto-zipkin-proto-http"
- "opentelemetry-exporter-otlp-proto-zipkin-json"
- "opentelemetry-propagator-b3"
- "opentelemetry-propagator-jaeger"
- "opentelemetry-test-utils"
os: [ubuntu-20.04]
runs-on: ubuntu-20.04
steps:
- name: Checkout Contrib Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install tox
run: pip install tox
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v4
with:
path: |
.tox
~/.cache/pip
key: v7-build-tox-cache-${{ matrix.package }}-${{ hashFiles('tox.ini', 'gen-requirements.txt', 'dev-requirements.txt') }}
- name: run tox
run: tox -e lint-${{ matrix.package }}
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- "exporter-zipkin-combined"
- "exporter-zipkin-proto-http"
- "exporter-zipkin-json"
- "protobuf"
- "proto"
- "propagator-b3"
- "propagator-jaeger"
os: [ubuntu-20.04, windows-2019]
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "lint", "spellcheck",
tox-environment: ["docker-tests-proto3", "docker-tests-proto4", "spellcheck",
"docs", "mypy", "mypyinstalled", "tracecontext"]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-20.04
Expand Down
Empty file.
2 changes: 1 addition & 1 deletion docs/getting_started/flask_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
@app.route("/")
def hello():
with tracer.start_as_current_span("example-request"):
requests.get("http://www.example.com")
requests.get("http://www.example.com", timeout=10)
return "hello"


Expand Down
6 changes: 6 additions & 0 deletions docs/getting_started/tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ urllib3==1.26.18
Werkzeug==3.0.1
wrapt==1.15.0
zipp==3.17.0
-e opentelemetry-semantic-conventions
-e opentelemetry-proto
-e exporter/opentelemetry-exporter-otlp-proto-common
-e exporter/opentelemetry-exporter-otlp-proto-grpc
-e opentelemetry-api
-e opentelemetry-sdk
6 changes: 4 additions & 2 deletions docs/getting_started/tests/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@

import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
from requests.packages.urllib3.util.retry import ( # pylint: disable=import-error
Retry,
)


class TestFlask(unittest.TestCase):
def test_flask(self):
dirpath = os.path.dirname(os.path.realpath(__file__))
server_script = f"{dirpath}/../flask_example.py"
server = subprocess.Popen(
server = subprocess.Popen( # pylint: disable=consider-using-with
[sys.executable, server_script],
stdout=subprocess.PIPE,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e tests/opentelemetry-test-utils
-e opentelemetry-semantic-conventions
-e exporter/opentelemetry-exporter-opencensus
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e tests/opentelemetry-test-utils
-e opentelemetry-proto
-e exporter/opentelemetry-exporter-otlp-proto-common
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,9 @@ tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e tests/opentelemetry-test-utils
-e opentelemetry-proto
-e exporter/opentelemetry-exporter-otlp-proto-common
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
-e opentelemetry-proto
-e opentelemetry-sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
-e opentelemetry-proto
-e opentelemetry-sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ urllib3==2.2.1
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
-e opentelemetry-proto
-e opentelemetry-sdk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ urllib3==2.2.1
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
-e opentelemetry-proto
-e opentelemetry-sdk
Expand Down
1 change: 1 addition & 0 deletions exporter/opentelemetry-exporter-otlp/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-otlp-proto-common
-e exporter/opentelemetry-exporter-otlp-proto-grpc
-e exporter/opentelemetry-exporter-otlp-proto-http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e tests/opentelemetry-test-utils
-e opentelemetry-semantic-conventions
-e exporter/opentelemetry-exporter-prometheus
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e tests/opentelemetry-test-utils
-e exporter/opentelemetry-exporter-zipkin-json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ urllib3==2.2.1
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-proto
-e exporter/opentelemetry-exporter-zipkin-json
-e opentelemetry-sdk
-e tests/opentelemetry-test-utils
-e opentelemetry-semantic-conventions
-e exporter/opentelemetry-exporter-zipkin-proto-http
15 changes: 15 additions & 0 deletions lint-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
astroid==3.0.3
black==24.3.0
click==8.1.7
dill==0.3.8
flake8==6.1.0
isort==5.12.0
mccabe==0.7.0
mypy-extensions==1.0.0
packaging==24.0
pathspec==0.12.1
platformdirs==4.2.1
pycodestyle==2.11.1
pyflakes==3.1.0
pylint==3.0.2
tomlkit==0.12.4
3 changes: 3 additions & 0 deletions opentelemetry-api/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e tests/opentelemetry-test-utils
-e opentelemetry-api
1 change: 1 addition & 0 deletions opentelemetry-sdk/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ tomli==2.0.1
typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e tests/opentelemetry-test-utils
-e opentelemetry-api
-e opentelemetry-semantic-conventions
-e opentelemetry-sdk
2 changes: 2 additions & 0 deletions propagator/opentelemetry-propagator-b3/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,6 @@ typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e propagator/opentelemetry-propagator-b3
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e opentelemetry-semantic-conventions
-e tests/opentelemetry-test-utils
-e propagator/opentelemetry-propagator-jaeger
3 changes: 3 additions & 0 deletions shim/opentelemetry-opencensus-shim/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ urllib3==2.2.1
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e tests/opentelemetry-test-utils
-e opentelemetry-semantic-conventions
-e shim/opentelemetry-opencensus-shim
3 changes: 3 additions & 0 deletions shim/opentelemetry-opentracing-shim/test-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ typing_extensions==4.10.0
wrapt==1.16.0
zipp==3.17.0
-e opentelemetry-api
-e opentelemetry-sdk
-e tests/opentelemetry-test-utils
-e opentelemetry-semantic-conventions
-e shim/opentelemetry-opentracing-shim
Loading

0 comments on commit bb8118a

Please sign in to comment.