Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate lint into several jobs #2467

Merged
merged 69 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
ed4a759
Separate lint for flask
ocelotl Apr 26, 2024
8891864
Seaparate lint for resource-detector-container
ocelotl Apr 26, 2024
09922ca
Add linting workflow
ocelotl Apr 26, 2024
c8ae3ae
Update contributing documentation
ocelotl Apr 26, 2024
1ef1c4f
Fix lint workflow
ocelotl Apr 26, 2024
85c70b3
Add fix for resource-detector-container
ocelotl Apr 26, 2024
97bc34c
Separate lint for sdk-extension-aws
ocelotl Apr 26, 2024
6fc6091
Separate lint for distro
ocelotl Apr 26, 2024
547291b
Separate lint for opentelemetry-instrumentation
ocelotl Apr 26, 2024
19068ab
Separate lint for aiohttp-client
ocelotl Apr 26, 2024
0aa2707
Separate lint for aiohttp-server
ocelotl Apr 26, 2024
2e3f4e5
Separate lint for aiopg
ocelotl Apr 26, 2024
5d9569d
Separate lint for aws-lambda
ocelotl Apr 26, 2024
f2ad5d2
Separate lint for botocore
ocelotl Apr 26, 2024
5800770
Separate lint for boto3sqs
ocelotl Apr 26, 2024
4da0f20
Separate lint for django
ocelotl Apr 26, 2024
354c5bf
Separate lint for dbapi
ocelotl Apr 26, 2024
4f80334
Separate lint for boto
ocelotl Apr 26, 2024
12448da
Separate lint for elasticsearch
ocelotl Apr 26, 2024
05f601b
Separate lint for falcon
ocelotl Apr 26, 2024
2d31edd
Separate lint for fastapi
ocelotl Apr 26, 2024
84fdacc
Separate lint for urllib
ocelotl Apr 26, 2024
a9b7a1e
Separate lint for urllib3
ocelotl Apr 26, 2024
ba68b72
Separate lint for requests
ocelotl Apr 26, 2024
9eac55e
Separate lint for starlette
ocelotl Apr 26, 2024
22f7dd2
Separate lint for jinja2
ocelotl Apr 26, 2024
3cff055
Seaparate lint for logging and richconsole
ocelotl Apr 26, 2024
9b0e6c8
Separate lint for prometheus-remote-write
ocelotl Apr 26, 2024
e017585
Separate lint for mysql
ocelotl Apr 26, 2024
9f75eb2
Separate lint for mysqlclient
ocelotl Apr 26, 2024
5290650
Separate lint for psycopg2
ocelotl Apr 26, 2024
4accd33
Separate lint for psycopg
ocelotl Apr 26, 2024
e10676a
Separate lint for pymemcache
ocelotl Apr 26, 2024
29159ef
Separate lint for pymongo
ocelotl Apr 26, 2024
c43430a
Separate lint for pymysql
ocelotl Apr 26, 2024
b13faf0
Separate lint for pyramid
ocelotl Apr 26, 2024
1a04333
Separate lint for asgi
ocelotl Apr 26, 2024
af239e2
Separate lint for asyncpg
ocelotl Apr 26, 2024
c0459e6
Separate lint for sqlite3
ocelotl Apr 26, 2024
455e8e6
Separate lint for wsgi
ocelotl Apr 26, 2024
c729ac6
Separate lint for grpc
ocelotl Apr 26, 2024
e089248
Separate lint for sqlalchemy
ocelotl Apr 26, 2024
c4d9bd7
Separate lint for redis
ocelotl Apr 26, 2024
6d0a4fd
Separate lint for remoulade
ocelotl Apr 26, 2024
e03d444
Separate lint for celery and sklearn
ocelotl Apr 26, 2024
6a53158
Separate lint for system-metrics
ocelotl Apr 26, 2024
fac12f5
Separate lint for threading
ocelotl Apr 26, 2024
4986b23
Separate lint for tornado
ocelotl Apr 26, 2024
3d1c387
Separate lint for tortoiseorm
ocelotl Apr 26, 2024
1df66dd
Separate lint for httpx
ocelotl Apr 26, 2024
893e125
Separate lint for propagator-aws-xray
ocelotl Apr 26, 2024
983a3de
Remove lint
ocelotl Apr 26, 2024
e0c90ae
Separate lint for propagator-ot-trace
ocelotl Apr 26, 2024
f3e8a9d
Separate lint for sio-pika
ocelotl Apr 26, 2024
7f8e71a
Separate lint for aio-pika
ocelotl Apr 26, 2024
f2cd9dd
Fix aio and sio pika
ocelotl Apr 26, 2024
6894d10
Separate lint for kafka-python
ocelotl Apr 26, 2024
713c6a5
Separate lint for confluent-kafka
ocelotl Apr 26, 2024
979f961
Separate lint for asyncio
ocelotl Apr 26, 2024
c5ae6a7
Separate lint for cassandra
ocelotl Apr 26, 2024
f94d44e
Separate lint for processor-baggage
ocelotl Apr 26, 2024
6f444cf
Remove lint test environment
ocelotl Apr 26, 2024
075567f
Rename lint workflow file
ocelotl Apr 26, 2024
96424c7
Fix sio-pika lint testing package path
ocelotl Apr 26, 2024
1e8bee4
More fixes
ocelotl Apr 26, 2024
de95426
Fix linting for opentelemetry-instrumentation
ocelotl Apr 27, 2024
a55e1c7
Add section for linting with 3.8
ocelotl Apr 27, 2024
84cee0a
Add missing lint install command for elasticsearch
ocelotl Apr 28, 2024
e1948e4
Sorted packages
ocelotl Apr 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
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:
- "instrumentation-flask"
- "resource-detector-container"
- "sdk-extension-aws"
- "distro"
- "opentelemetry-instrumentation"
- "instrumentation-aiohttp-client"
- "instrumentation-aiohttp-server"
- "instrumentation-aiopg"
- "instrumentation-aws-lambda"
- "instrumentation-botocore"
- "instrumentation-boto3sqs"
- "instrumentation-django"
- "instrumentation-dbapi"
- "instrumentation-boto"
- "instrumentation-elasticsearch"
- "instrumentation-falcon"
- "instrumentation-fastapi"
- "instrumentation-urllib"
- "instrumentation-urllib3"
- "instrumentation-requests"
- "instrumentation-starlette"
- "instrumentation-jinja2"
- "instrumentation-logging"
- "exporter-richconsole"
- "exporter-prometheus-remote-write"
- "instrumentation-mysql"
- "instrumentation-mysqlclient"
- "instrumentation-psycopg2"
- "instrumentation-psycopg"
- "instrumentation-pymemcache"
- "instrumentation-pymongo"
- "instrumentation-pymysql"
- "instrumentation-pyramid"
- "instrumentation-asgi"
- "instrumentation-asyncpg"
- "instrumentation-sqlite3"
- "instrumentation-wsgi"
- "instrumentation-grpc"
- "instrumentation-sqlalchemy"
- "instrumentation-redis"
- "instrumentation-remoulade"
- "instrumentation-celery"
- "instrumentation-system-metrics"
- "instrumentation-threading"
- "instrumentation-tornado"
- "instrumentation-tortoiseorm"
- "instrumentation-httpx"
- "propagator-aws-xray"
- "propagator-ot-trace"
- "instrumentation-sio-pika"
- "instrumentation-aio-pika"
- "instrumentation-kafka-python"
- "instrumentation-confluent-kafka"
- "instrumentation-asyncio"
- "instrumentation-cassandra"
- "processor-baggage"
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 }}

lint-3_8:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
package:
- "instrumentation-sklearn"
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.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- 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 }}
5 changes: 1 addition & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
tox-environment: [ "docker-tests", "spellcheck", "lint", "docs", "generate" ]
tox-environment: [ "docker-tests", "spellcheck", "docs", "generate" ]
name: ${{ matrix.tox-environment }}
runs-on: ubuntu-20.04
steps:
Expand All @@ -25,9 +25,6 @@ jobs:
python-version: "3.10"
- name: Install tox
run: pip install tox
- name: Install libsnappy-dev
if: ${{ matrix.tox-environment == 'lint' }}
run: sudo apt-get install -y libsnappy-dev
- name: Cache tox environment
# Preserves .tox directory between runs for faster installs
uses: actions/cache@v4
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ You can run `tox` with the following arguments:
- `tox -e py311-test-instrumentation-aiopg` to e.g. run the aiopg instrumentation unit tests under a specific
Python version
- `tox -e spellcheck` to run a spellcheck on all the code
- `tox -e lint` to run lint checks on all code
- `tox -e lint-some-package` to run lint checks on `some-package`

`black` and `isort` are executed when `tox -e lint` is run. The reported errors can be tedious to fix manually.
An easier way to do so is:

1. Run `.tox/lint/bin/black .`
2. Run `.tox/lint/bin/isort .`
1. Run `.tox/lint-some-package/bin/black .`
2. Run `.tox/lint-some-package/bin/isort .`

See
[`tox.ini`](https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/tox.ini)
Expand Down
Loading
Loading