Pluggy 1.7.0 breaks scancode

未关闭
#5,363 2 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
cli

调研方向

The traceback points to plugincode/__init__.py line 182, where add_hookspecs is called on the plugincode.pre_scan module, and then into pluggy's _manager.py add_hookspecs, which raises when it finds no hook markers. Start by reproducing with pluggy 1.7.0 and comparing how plugincode/pre_scan.py marks its hookspecs against the 1.6.0 behaviour. Done means the scancode CLI runs on pluggy 1.7.0 and its plugin tests pass.

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

描述

bug
Description

The update to pluggy 1.7.0 from a few hours ago results in the following error when trying to run scancode (in version scancode_toolkit-32.5.0-cp313):

Traceback (most recent call last):
  File "/usr/local/bin/scancode", line 5, in <module>
    from scancode.cli import scancode
  File "/usr/local/lib/python3.13/dist-packages/scancode/cli.py", line 57, in <module>
    from plugincode import pre_scan
  File "/usr/local/lib/python3.13/dist-packages/plugincode/pre_scan.py", line 30, in <module>
    pre_scan_plugins = PluginManager(
        stage=stage, module_qname=__name__, entrypoint=entrypoint, plugin_base_class=PreScanPlugin
    )
  File "/usr/local/lib/python3.13/dist-packages/plugincode/__init__.py", line 182, in __init__
    self.manager.add_hookspecs(sys.modules[module_qname])
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/dist-packages/pluggy/_manager.py", line 366, in add_hookspecs
    raise ValueError(
        f"did not find any {self.project_name!r} hooks in {module_or_class!r}"
    )
ValueError: did not find any 'pre_scan' hooks in <module 'plugincode.pre_scan' from '/usr/local/lib/python3.13/dist-packages/plugincode/pre_scan.py'>
How To Reproduce

Install the latest pluggy and scancode versions:

pip3 install pyyaml pluggy==1.7.0 scancode-toolkit

and try to run scancode.

Fixing pluggy to the previous version fixes the issue:

pip3 install pyyaml pluggy==1.6.0 scancode-toolkit
主要语言
Python
星标
2.7k
派生
831
平均合并
3 天 4 小时
30 天内合并 PR
7

环境准备

从这里开始

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

aboutcode-org/scancode-toolkit 的其他 Issue

查看 aboutcode-org/scancode-toolkit 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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