matrix-org / matrix-org/matrix-python-sdk
Add canonicaljson to runtime dependencies
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 266
- Fork
- 118
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dall’elenco delle dipendenze intorno alla riga 47 di setup.py e ispeziona l’import in crypto/olm_device.py. Riproduci la creazione di MatrixClient con la crittografia abilitata e canonicaljson assente, quindi verifica che dichiarare canonicaljson come dipendenza di runtime consenta all’esempio documentato di creare un client senza la gestione fuorviante di ImportError.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- build-system
- Tipo di issue
- Bug
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 55/100