Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PlugincodeError: Invalid plugin #3408

Closed
AyanSinhaMahapatra opened this issue May 23, 2023 · 2 comments
Closed

PlugincodeError: Invalid plugin #3408

AyanSinhaMahapatra opened this issue May 23, 2023 · 2 comments

Comments

@AyanSinhaMahapatra
Copy link
Member

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.

@AyanSinhaMahapatra AyanSinhaMahapatra modified the milestones: v32.1, v32.0 May 23, 2023
AyanSinhaMahapatra added a commit that referenced this issue May 23, 2023
Reference: #3408
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
@AyanSinhaMahapatra
Copy link
Member Author

So the issue was that we had a setup-mini.cfg which was not consistent with setup.cfg and some updates were only applied to the later. As we use the setup-mini.cfg to build the python sdists and wheels, this was creating the issue in pip install, but not in the release archives. Fixed in the PR above ^

@AyanSinhaMahapatra
Copy link
Member Author

This is fixed, closing!

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

No branches or pull requests

1 participant