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 1 commit
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
23 changes: 23 additions & 0 deletions content/en/docs/instrumentation/python/mypy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Using mypy
weight: 5
cartermp marked this conversation as resolved.
Show resolved Hide resolved
---

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).
cartermp marked this conversation as resolved.
Show resolved Hide resolved

In your project configuration file, add the following:
cartermp marked this conversation as resolved.
Show resolved Hide resolved

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

Or if you'd prefer a command-line switch, use `--namespace-packages`:
cartermp marked this conversation as resolved.
Show resolved Hide resolved

```console
cartermp marked this conversation as resolved.
Show resolved Hide resolved
mypy --namespace-packages
```

If you don't turn on namespace packages, then mypy won't be able to correctly
run.
cartermp marked this conversation as resolved.
Show resolved Hide resolved