Report helpful error message for missing "jwt" dependency

未关闭
#526 5 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
python

调研方向

首先跟踪报告中显示的 JWTAuth.from_settings_file 调用,并检查可选依赖 jwt 的加载方式。在不安装 boxsdk[jwt] 的情况下重现缺少依赖的情形,然后让错误提示建议运行 pip install boxsdk[jwt],并验证安装该依赖后现有的 JWT 路径仍然有效。

由索引模型根据 Issue 内容生成。

描述

enhancement
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

主要语言
Python
星标
460
派生
223
平均合并
14 小时 18 分钟
30 天内合并 PR
21

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

box/box-python-sdk 的其他 Issue

查看 box/box-python-sdk 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。