matrix-org / matrix-org/matrix-python-sdk
Add canonicaljson to runtime dependencies
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 266
- フォーク
- 118
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Describe the bug
The module crypto/olm_device.py imports the canonicaljson packages which is not listed in the projects runtime dependencies. When creating a MatrixClient object with encryption=True but missing installation of canonicaljson the resulting ImportError is caught. The further handling of this Error makes it look like python-olm package is not installed.
To Reproduce
Steps to reproduce the behavior, with python-olm installed but missing canonicaljson:
- Create a MatrixClient object with encryption enabled:
from matrix_client.client import MatrixClient
client = MatrixClient("http://localhost:8008", encryption=True)
Expected behavior
These two lines should result in the creation of a MatrixClient object.
Desktop (please complete the following information):
- OS: Debian 11
- Version: Python 3.8.8, matrix-client 0.4.0
Additional context
This can be fixed by adding 'canonicaljson' to the list started in line 47 in setup.py. Even if the additional packages is only used when encryption is enabled, installing it always seems to be the preferable option, especially because the import error is masked.
I'd be willing to create a PR to fix this.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
setup.py の47行目付近にある依存関係の一覧から始め、crypto/olm_device.py の import を調べます。暗号化を有効にし、canonicaljson が存在しない状態で MatrixClient の作成を再現し、その後、canonicaljson を実行時依存関係として宣言すると、ドキュメント化された例で誤解を招く ImportError の処理なしにクライアントを作成できることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- build-system
- issue の種類
- バグ
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 55/100