aboutcode-org / aboutcode-org/scancode-toolkit

Accesses gemfileparser which is not installed

未关闭
#3,160 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
Python
星标
2.6k
派生
791
平均合并
1 天 12 小时
30 天内合并 PR
5

描述

### Description

Installation of scancode-toolkit using pip (version 32.2.1) also installs gemfileparser2, but code still depends on gemfileparser, which is not installed automatically.
File `spec.py` imports from `gemfileparser`, not from `gemfileparser2`.

### How To Reproduce

In a python environment with all the necessary OS libraries, e. g. a docker container for image python:3.9-slim:

```
# I started in a directory /app
# mkdir /app
# cd /app

python -m venv venv-scancode
. venv-scancode/bin/activate
pip install --upgrade pip
pip install wheel
pip install scancode-toolkit

./venv-scancode/bin/scancode --example
```

Results in

```
========================================================================
ERROR: UNABLE TO IMPORT SCANCODE PLUGINS.
Check your installation configuration (setup.py) or re-install/re-configure ScanCode.
The following plugin(s) are referenced and cannot be loaded/imported:
No module named 'gemfileparser'
========================================================================
Traceback (most recent call last):
File "/app/./venv-scancode/bin/scancode", line 5, in
from scancode.cli import scancode
File "/app/venv-scancode/lib/python3.9/site-packages/scancode/cli.py", line 126, in
raise e
File "/app/venv-scancode/lib/python3.9/site-packages/scancode/cli.py", line 113, in
plugin_classes, plugin_options = PluginManager.load_plugins()
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 196, in load_plugins
mgr_setup = manager.setup()
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 222, in setup
raise e
File "/app/venv-scancode/lib/python3.9/site-packages/plugincode/__init__.py", line 220, in setup
self.manager.load_setuptools_entrypoints(entrypoint)
File "/app/venv-scancode/lib/python3.9/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
plugin = ep.load()
File "/usr/local/lib/python3.9/importlib/metadata.py", line 86, in load
module = import_module(match.group('module'))
File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/__init__.py", line 24, in
from packagedcode import cocoapods
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/cocoapods.py", line 21, in
from packagedcode import spec
File "/app/venv-scancode/lib/python3.9/site-packages/packagedcode/spec.py", line 12, in
from gemfileparser import GemfileParser
ModuleNotFoundError: No module named 'gemfileparser'
```

After

```
pip install gemfileparser
```

calling scancode again succeeds.

### System configuration

* Linux
* scancode-toolkit version 32.2.1
* installation method pip

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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