Skip to content

Commit

Permalink
Add pyright and fix the reported issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kjagiello committed Sep 21, 2024
1 parent b103078 commit 90f4eca
Show file tree
Hide file tree
Showing 17 changed files with 44 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/misc_0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,24 @@ jobs:
- name: Run tests
run: tox -e mypy

pyright:
name: pyright
runs-on: ubuntu-latest
steps:
- name: Checkout repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install tox
run: pip install tox

- name: Run tests
run: tox -e pyright

mypyinstalled:
name: mypyinstalled
runs-on: ubuntu-latest
Expand Down
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,12 @@ exclude = '''
[tool.pytest.ini_options]
addopts = "-rs -v"
log_cli = true

[tool.pyright]
typeCheckingMode = "off"
reportMissingTypeStubs = "error"
include = [
"opentelemetry-api/src",
"opentelemetry-sdk/src",
"opentelemetry-semantic-conventions/src",
]
1 change: 1 addition & 0 deletions pyright-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pyright==1.1.381
16 changes: 16 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ envlist =
spellcheck
tracecontext
mypy,mypyinstalled
pyright
docs
docker-tests-proto{3,4}
public-symbols-check
Expand Down Expand Up @@ -445,3 +446,18 @@ commands_pre =

commands =
sh -c "find {toxinidir} -name \*.sh | xargs shellcheck --severity=warning"

[testenv:pyright]
basepython: python3

allowlist_externals = pyright

commands_pre =
pip install -r {toxinidir}/pyright-requirements.txt \
-e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-semantic-conventions \
-e {toxinidir}/opentelemetry-sdk

commands =
pyright --version
pyright

0 comments on commit 90f4eca

Please sign in to comment.