Skip to content

PlugincodeError: Invalid plugin #3408

Description

@AyanSinhaMahapatra

Description

Please leave a brief description of the bug or feature request:

/home/ayansinha/nexB/venvs/scancode-32.0.0-py311-new/lib/python3.11/site-packages/typecode/magic2.py:195: UserWarning: System libmagic found in typical location is used. Install instead a typecode-libmagic plugin for best support.
  warnings.warn(
Traceback (most recent call last):
  File "/home/ayansinha/nexB/venvs/scancode-32.0.0-py311-new/bin/scancode", line 5, in <module>
    from scancode.cli import scancode
  File "/home/ayansinha/nexB/venvs/scancode-32.0.0-py311-new/lib/python3.11/site-packages/scancode/cli.py", line 113, in <module>
    plugin_classes, plugin_options = PluginManager.load_plugins()
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ayansinha/nexB/venvs/scancode-32.0.0-py311-new/lib/python3.11/site-packages/plugincode/__init__.py", line 199, in load_plugins
    mgr_setup = manager.setup()
                ^^^^^^^^^^^^^^^
  File "/home/ayansinha/nexB/venvs/scancode-32.0.0-py311-new/lib/python3.11/site-packages/plugincode/__init__.py", line 236, in setup
    raise PlugincodeError(
plugincode.PlugincodeError: Invalid plugin: 'pre_scan:classify': <class 'summarycode.classify_plugin.FileClassifier'> must extend <class 'plugincode.pre_scan.PreScanPlugin'>.

How To Reproduce

Tell us how to reproduce the issue.

python3.11 -m venv venvs/scancode-32.0.0-py311/
source venvs/scancode-32.0.0-py311/bin/activate
pip install scancode-toolkit
scancode -h

System configuration

For bug reports, it really helps us to know:

  • What OS are you running on? (Windows/MacOS/Linux) ubuntu-20.04
  • What version of scancode-toolkit was used to generate the scan file? v32.0.0
  • What installation method was used to install/run scancode? (pip/source download/other) pip

@jyang pointed out that the setup.cfg at https://files.pythonhosted.org/packages/88/4b/79ca4c6f06c5b9ad1f5f601f1191e207fa05dcbccb2c4a46b381d3ad98af/scancode-toolkit-32.0.0.tar.gz is different from the one we have in https://github.com/nexB/scancode-toolkit/blob/develop/setup.cfg#L198
in terms of where the summarycode.classify_plugin:FileClassifier is located in entry_points. It is in pre_scan in the former, and in post_scan in the later, which is causing the failure.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions