matrix-org / matrix-org/matrix-python-sdk
Add canonicaljson to runtime dependencies
Personne n'a encore pris cette issue.
- Langage dominant
- Python
- Étoiles
- 266
- Forks
- 118
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la liste des dépendances autour de la ligne 47 de setup.py et examinez l’import dans crypto/olm_device.py. Reproduisez la création de MatrixClient avec le chiffrement activé et canonicaljson absent, puis vérifiez que la déclaration de canonicaljson comme dépendance d’exécution permet à l’exemple documenté de créer un client sans la gestion trompeuse de ImportError.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- python
- Domaine
- build-system
- Type d'issue
- Bug
- Difficulté
- 1/5
- Temps estimé
- Moins d'une heure
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 55/100