Skip to content

Commit

Permalink
Add mypy doc (#1611)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermp authored Aug 24, 2022
1 parent 647f460 commit 2c9730b
Showing 1 changed file with 33 additions and 0 deletions.
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
```

0 comments on commit 2c9730b

Please sign in to comment.