已关闭
依赖不完整 #5
李超然创建于  8月24日关闭于  9月3日
李超然
李超然
8月24日 创建

【缺陷描述】:请补充详细的缺陷问题现象描述

执行➜ oed services时报错

一、缺陷信息

    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/click/core.py", line 1353, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/click/core.py", line 907, in invoke
    return callback(*args, **kwargs)
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/oed_cli/cli.py", line 175, in services_cmd
    feed = _resolve_feed(force_refresh=refresh)
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/oed_cli/cli.py", line 45, in _resolve_feed
    return fetch_discovery(community=None, force_refresh=force_refresh)
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/oed_cli/discovery.py", line 148, in fetch_discovery
    feed = _fetch_remote(community)
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/oed_cli/discovery.py", line 126, in _fetch_remote
    data = get_json(APIS_URL)
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/oed_cli/http.py", line 79, in get_json
    return _decode(get_request("GET", url, params=params, headers=headers), spec_endpoint=True)
                   ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/oed_cli/http.py", line 111, in get_request
    with httpx.Client(timeout=timeout, follow_redirects=True) as client:
         ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/httpx/_client.py", line 700, in __init__
    else self._init_proxy_transport(
         ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        proxy,
        ^^^^^^
    ...<5 lines>...
        limits=limits,
        ^^^^^^^^^^^^^^
    )
    ^
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/httpx/_client.py", line 750, in _init_proxy_transport
    return HTTPTransport(
        verify=verify,
    ...<5 lines>...
        proxy=proxy,
    )
  File "/home/lcr/.local/share/mise/installs/python/3.13.15/lib/python3.13/site-packages/httpx/_transports/default.py", line 191, in __init__
    raise ImportError(
    ...<2 lines>...
    ) from None
ImportError: Using SOCKS proxy, but the 'socksio' package is not installed. Make sure to install httpx using `pip install httpx[socks]`.

【缺陷所属的os版本】

debian 13

【内核版本】

【缺陷所属软件及版本号】

0.1.6

【环境信息】

➜ oed --version
oed, version 0.1.6

【问题复现步骤】

【实际结果】

【期望结果】

【其他相关附件信息】

【缺陷详情及分析指导参考链接】

likedislike
openeuler-ci-botopeneuler-ci-bot成员
8月24日 添加了label:sig/sig-EasyLife
openeuler-ci-bot
openeuler-ci-bot成员
8月24日 评论:

Welcome To openEuler Community

Hey @mywaaagh_admin , thanks for your contribution to the community.

Bot Usage Manual

I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.

Contact Guide

If you have any questions, please contact the SIG: sig-EasyLife ,
and any of the maintainers: @Apricity_HW, @chenyanpan, @licihua, @liheavy, @shinwell_hu, @solarhu ,
and any of the committers: @shinwell_hu .

likedislike
HHouRunZe
9月3日 关联了pull request:feat: release v0.3.0 — auth device flow + 完整性校验
zwjsec成员
9月3日 评论:

经分析 错误根因如下:
当前运行环境上配置了 SOCKS 代理,但是缺少 SOCKS 依赖包 socksio
oed_cli 在创建 httpx.Client() 的时候,httpx 自动读取了系统代理环境变量,httpx 尝试启用 SOCKS 代理,然后检查 socksio 包,找不到就抛这个 ImportError。

经评估:该问题非oed的本身依赖缺失,是运行环境配置了socks代理变量,但是缺少socksio

考虑到CLI不应主动安装socksio,因此我们修复了这个import error,转而提示用户安装socksio。

likedislike
zwjsec成员
9月3日 评论:

参考Python 包设计惯例,已将 socksio移动到optional-dependencies中,必要用户可以执行pip install oed-cli[socks]进行可选安装

likedislike
openeuler-ci-botopeneuler-ci-bot成员
9月3日 关闭了 issue
openeuler-ci-botopeneuler-ci-bot成员
9月3日 issue状态由 待办的 改变为 已完成
YYuren1231
5 天前 关联了pull request:feat(help): close the --help contract and validate --dry-run requests (issue #4)