elastic / elastic/apm-agent-python

Documentation uses reexports that are not included in `__all__`

オープン
#2,197 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
agent-python community triage
主要言語
Python
スター
431
フォーク
239
平均マージ
5日 10時間
マージ済み PR(30日)
7

説明

**Describe the bug**:
The documentation for this library references decorators like `@elasticapm.capture_span()` or functions (e.g. `elasticapm.instrument()`) however they are not included in the `__all__` variable. This causes type checkers (e.g. pyright/mypy) to complain because they expect explicit reexports via `__all__`. What's weird is that `__all__` is defined, but the intended reexports (at least from looking at the documentation) are not added.

This makes it extremely confusing for someone that is new elasticapm, and the code becomes littered with`# pyright: ignore` comments or imports from various subpackages.

**To Reproduce**

1. Install pyright
2. Follow documentation (e.g. use a capture_span like so https://www.elastic.co/guide/en/apm/agent/python/current/instrumenting-custom-code.html#instrumenting-custom-code-spans)
3. Verify that pyright will complain that `"capture_span" is not exported from module "elasticapm" (Pyright reportPrivateImportUsage)`

**Environment (please complete the following information)**
- Agent version: 6.23.0

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。