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

Add mypy doc #1611

Merged
merged 4 commits into from
Aug 24, 2022
Merged
Changes from all commits
Commits
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
33 changes: 33 additions & 0 deletions content/en/docs/instrumentation/python/mypy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Using mypy
---

If you're using [mypy](http://mypy-lang.org/), you'll need to turn on [namespace
packages](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-namespace-packages),
otherwise `mypy` won't be able to run correctly.

To turn on namespace packages, do one of the following:

Add the following to your project configuration file:

```toml
[tool.mypy]
namespace_packages = true
```

Or, use a command-line switch:

```shell
mypy --namespace-packages
```

## Using the `strict` option

If you're using the `strict` option with mypy, and you're using the
OpenTelemetry Python SDK (instead of just the API), you'll need to also set the
following in your project configuration file:

```toml
[mypy-opentelemetry.sdk.*]
implicit_reexport = True
```