Skip to content

Tox doesn't run mypy on the sdk code #773

@aabmass

Description

@aabmass

Currently, tox.ini only has mypy running on the api, so the sdk is not covered in CI:

mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/
; For test code, we don't want to enforce the full mypy strictness
mypy: mypy --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/
; Test that mypy can pick up typeinfo from an installed package (otherwise,
; implicit Any due to unfollowed import would result).
mypyinstalled: mypy --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict

See the commands in an example run:

$ tox -e mypy
mypy installed: mypy==0.770,mypy-extensions==0.4.3,typed-ast==1.4.1,typing-extensions==3.7.4.2
mypy run-test-pre: PYTHONHASHSEED='1981813759'
mypy run-test: commands[0] | mypy --namespace-packages opentelemetry-api/src/opentelemetry/
Success: no issues found in 21 source files
mypy run-test: commands[1] | mypy --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/
Success: no issues found in 20 source files
__________________________________________________________________ summary ___________________________________________________________________
  mypy: commands succeeded
  congratulations :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions