Report helpful error message for missing "jwt" dependency
- 主要语言
- Python
- 星标
- 459
- 派生
- 223
- 平均合并
- 8 小时 57 分钟
- 30 天内合并 PR
- 13
描述
### Is your feature request related to a problem? Please describe.
As is known from closed issue (https://github.com/box/box-python-sdk/issues/387) if you don't `pip install "boxsdk[jwt]"`, and use the JWT authorization, you get a somewhat confusing message:
```
File "/Users/first.last/workspace/repo_name/box/../lib/box.py", line 70, in get_jwt_client
auth = boxsdk.JWTAuth.from_settings_file(load_config(self.app_name))
AttributeError: 'NoneType' object has no attribute 'from_settings_file'
```
### Describe the solution you'd like
Return an error message instead that at least suggests "Did you try pip install boxsdk[jwt]?" when JWTAuth isn't going to work.
### Additional context
Using sdk version `boxsdk 2.9.0`
贡献指南
调研方向
首先跟踪报告中显示的 JWTAuth.from_settings_file 调用,并检查可选依赖 jwt 的加载方式。在不安装 boxsdk[jwt] 的情况下重现缺少依赖的情形,然后让错误提示建议运行 pip install boxsdk[jwt],并验证安装该依赖后现有的 JWT 路径仍然有效。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- authentication
- Issue 类型
- 功能
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 48/100